This is close to playing the storage process, using the with encryption to encrypt, after adding this statement, you can't see the original storage process in SQL Server 2000, one to listen, huh! The decryption tool is really a lot. Such as: SQL Explorer, View SQL and other tools can decrypt very well, see the original storage process. There is the following code on the Internet, saying that it can decrypt, did not tried, put it first, have time to study again.
I am very happy today, using my own blog! Create a stored procedure to use the with encryption this, decrypt the stored procedure - Decryption stored procedure CREATE Procedure sp_decrypt (@Objectname varchar (50)) asbeginset NoCount ON - Crack bytes unrestricted, suitable for SQLServer2000 stored procedures, functions , View, Trigger - Correct the previous version of the video trigger does not correctly decrypt the error becom transeclare @ Objectname1 varchar (100), @ orgvarbin varbinary (8000) Declare @ SQL1 nVARCHAR (4000), @ SQL2 varchar (8000) 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 intdeclare @colid int, @ n int, @ q int, @ j int, @ k int, @ encrypted int, @ number intselect @ 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 #tempset @ K = 0WHILE @K <= @ Number BeginiF EXISTS (SELECT 1 from syscomments where id = Object_id (@Object) Name) and Number = @ K) Beginif @ Type = 'p'SET @ SQL1 = (Case When @Number> 1 TEN' ALTER Procedure ' @ObjectName '; ' RTRIM (@K) ' with Encryption As' else 'ALTER PROCEDURE' @ objectName 'WITH ENCRYPTION AS' end) if @ type = 'TR'begindeclare @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_objif @ tr_parent_xtype = 'V'beginset @ sql1 =' ALTER TRIGGER ' @ objectname ' ON ' OBJECT_NAME (@parentid) ' WITH ENCRYPTION INSTERD OF INSERT AS PRINT 1 'endelsebeginset @ sql1 =' ALTER TRIGGER ' @ objectname ' ON ' OBJECT_NAME (@parentid) ' WITH ENCRYPTION FOR INSERT AS PRINT 1 'endendif @ type =' FN 'or @ type =' TF 'or @ type =' If'Set @ SQL1 = (Case @Type when 'TF' TEN 'ALTER FUNCTION' @Objectname '(@ a char (1)) Returns @B Table (a varchar (10)) with encryption as begin insert @B SELECT @A RETURN END 'WHEN' FN 'THEN'ALTER FUNCTION' @Objectname '(@ a char (1)) Returns Char (1) with encryption as begin Return @a end'when' ing 'then'alter function' @Objectname '(@ a char (1)) Returns Table with encryption as return select @a as a'end) if @ Type =' V'Set @ SQL1 = 'Alter View' @ Objectname 'with Encryption As SELECT 1 AS F'SET @ q = len (@ SQL1) set @ SQL1 = @ SQL1 Replicate ('-', 4000- @ q) SELECT @ SQL2 = Replicate ('-', 8000) set @ SQL3 = 'Exec (@ SQL1 'select @ colid = Max (colid) from #temp where number = @ K set @ n = 1WHILE @n <= ceiling (1.0 * (@ colid-1) / 2) And len (@ SQL3) <= 3996BEGIN SET @ SQL3 = @ SQL3 ' @ 'set @ n = @ n 1ndset @ SQL3 = @ SQL3 '
) 'EXEC SP_EXECUTESQL @ SQL3, N' @ SQL1 NVARCHAR (4000), @ sql1 = @ SQL1, @ = @ SQL2ENDSET @ K = @ K 1ndSet @ K = 0WHILE @ = @ Number beginif exists (select 1 from syscomments where id = object_id (@objectname) and number = @ k) beginselect @ colid = max (colid) from #temp where number = set n = 1while @n @ @ k <= @ colidbeginselect @ OrigSpText1 = ctext, @ encrypted = encrypted, @ status = status FROM #temp WHERE colid = @ n and number = @ kSET @ OrigSpText3 = (SELECT ctext FROM syscomments WHERE id = object_id (@objectName) and colid = @ n and number = @ K) if @ n = 1beginif @ Type = 'p'set @ origsptext2 = (Case when @number> 1 Then' crete procedure ' @objectname '; ' RTRIM (@K) ' with encryption as 'else' Create Procedure ' @Objectname ' with encryption as' end) if @ type = 'fn' or @ type = 'tf' or @ type = 'iF'Et @ origsptext2 = (Case @Type when' Tf 'Then' Create Function ' @objectname ' (@ a char (1)) Returns @B Table (a varchar (10)) with encryption as begin insert @B select @a return end 'when' fn 'dam @ Objectname '(@a char (1)) Returns Char (1) with encryption as begin Return @a end'when 'f' dam @Objectname '(@ a char (1)) Returns Table with encryption as return select @a as a'end) @ @ a TYPE = 'tr' beginif @