SQL SERVER ´æ´¢¹ý³Ì¼ÓÃܺͽâÃÜ
create PROCEDURE sp_decrypt(@objectname varchar(50))
AS
begin
set nocount on
--CSDN£ºj9988 copyright:2004.07.15
--V3.2
--Æƽâ×Ö½Ú²»ÊÜÏÞÖÆ£¬ÊÊÓÃÓÚSQLSERVER2000´æ´¢¹ý³Ì£¬º¯Êý£¬ÊÓͼ£¬´¥·¢Æ÷
--ÐÞÕýÉÏÒ»°æ"ÊÓͼ´¥·¢Æ÷"²»ÄÜÕýÈ·½âÃÜ´íÎó
--·¢ÏÖÓÐ´í£¬ÇëE_MAIL£ºCSDNj9988@tom.com
begin tran
declare @objectname1 varchar(100),@orgvarbin varbinary(8000)
declare @sql1 nvarchar(4000),@sql2 varchar(8000),@sql3 nvarchar(4000),@sql4 nvarchar(4000)
DECLARE @OrigSpText1 nvarchar(4000), @OrigSpText2 nvarchar(4000) , @OrigSpText3 nvarchar(4000), @resultsp nvarchar(4000)
declare @i int,@status int,@type varchar(10),@parentid int
declare @colid int,@n int,@q int,@j int,@k int,@encrypted int,@number int
select @type=xtype,@parentid=parent_obj from sysobjects where id=object_id(@objectname)
create table #temp(number int,colid int,ctext varbinary(8000),encrypted int,status int)
insert #temp Select number,colid,ctext,encrypted,status from syscomments Where id = object_id(@objectname)
select @number=max(number) from #temp
set @k=0
while @k<=@number
begin
if exists(select 1 from syscomments where id=object_id(@objectname) and number=@k
)
begin
if @type='P'
set @sql1=(case when @number>1 then 'Alter PROCEDURE '+ @objectname +';'+rtrim(@k)+' WITH ENCRYPTION AS '
else 'Alter PROCEDURE '+ @objectname+' WITH ENCRYPTION AS '
end)
if @type='TR'
begin
declare @parent_obj varchar(255),@tr_parent_xtype varchar(10)
select @parent_obj=parent_obj from sysobjects where id=object_id(@objectname)
select @tr_parent_xtype=xtype from sysobjects where id=@parent_obj
if @tr_parent_xtype='V'
begin
set @sql1='Alter TRIGGER '+@objectname+'
ON '+OBJECT_NAME(@parentid)+' WITH ENCRYPTION INSTERD OF Insert AS PRINT 1 '
end
else
begin
set @sql1='Alter TRIGGER '+@objectname+'
ON '+OBJECT_NAME(@parentid)+' WITH ENCRYPTION FOR Insert AS PRINT 1 '
end
end
if @type='FN' or @type='TF' or @type='IF'
set @sql1=(case @type when 'TF' then
'Alter
FUNCTION '+ @objectn
Ïà¹ØÎĵµ£º
SQL Server2005°æ±¾ºÅ£º
Ҫȷ¶¨ËùÔËÐÐµÄ SQL Server 2005 µÄ°æ±¾£¬ÇëʹÓà SQL Server Management Studio Á¬½Óµ½ SQL Server 2005£¬È»ºóÔËÐÐÒÔÏ Transact-SQL Óï¾ä£º(´ËSQLÓï¾äͬÑùÊÊÓÃÓÚSQL2000)
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
²éѯ½á¹ûÈçÏ£ ......
´¥·¢Æ÷ʵ¼ÊÉϾÍÊÇÒ»ÖÖÌØÊâÀàÐ͵Ĵ洢¹ý³Ì£¬ÆäÌØÊâÐÔ±íÏÖÔÚ£ºËüÊÇÔÚÖ´ÐÐÌض¨µÄT-SQL ×Ô¶¯Ïà¼ÓµÄ¡£
´¥·¢Æ÷·ÖΪÁ½Àࣺ
&nbs ......
SQL×¢Èëʽ¹¥»÷ÊÇÀûÓÃÊÇÖ¸ÀûÓÃÉè¼ÆÉϵÄ©¶´£¬ÔÚÄ¿±ê·þÎñÆ÷ÉÏÔËÐÐSqlÃüÁîÒÔ¼°½øÐÐÆäËû·½Ê½µÄ¹¥»÷¶¯Ì¬Éú³ÉSqlÃüÁîʱûÓжÔÓû§ÊäÈëµÄÊý¾Ý½øÐÐÑéÖ¤ÊÇSql×¢Èë¹¥»÷µÃ³ÑµÄÖ÷ÒªÔÒò¡£
±ÈÈ磺
Èç¹ûÄãµÄ²éѯÓï¾äÊÇselect * from admin where username="&user&" and password="&pwd&""
ÄÇô£¬Èç¹ûÎÒµÄÓû§ÃûÊ ......
SQLÓï¾äµÄÌí¼Ó¡¢É¾³ý¡¢ÐÞ¸ÄËäÈ»ÓÐÈçϺܶàÖÖ·½·¨£¬µ«ÔÚʹÓùý³ÌÖл¹ÊDz»¹»Ó㬲»ÖªÊÇ·ñÓиßÊְѸü¶àÁé»îµÄʹÓ÷½·¨¹±Ï׳öÀ´£¿
Ìí¼Ó¡¢É¾³ý¡¢ÐÞ¸ÄʹÓÃdb.Execute(Sql)ÃüÁîÖ´ÐвÙ×÷
╔----------------╗
¡î Êý¾Ý¼Ç¼ɸѡ ¡î
╚----------------╝
×¢Ò⣺µ¥Ë«ÒýºÅµÄÓ÷¨¿ÉÄÜÓÐÎó(ûÓвâʽ)
Sql = "S ......
ÔÎĵØÖ·£ºhttp://topic.csdn.net/u/20100203/17
/8F916471-597D-481A-B170-83BCEFE3B199.html
============================ÎÒÊÇ·Ö¸î
·û================================
Ó¦Ò»¸öÅóÓѵÄÒªÇó£¬ÌùÉÏÊղصÄSQL³£Ó÷ÖÒ³µÄ°ì·¨¡«¡«
±íÖÐÖ÷¼ü±ØÐëΪ±êʶÁÐ
£¬[ID] int IDENTITY (1,1)
1.·ÖÒ³·½°¸Ò»£º(ÀûÓÃNot InºÍSELECT ......