當前位置:首頁 » 編程語言 » sql2005解密存儲過程
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

sql2005解密存儲過程

發布時間: 2022-01-15 13:35:46

sql存儲過程可以解密嗎

可以,CREATE PROCEDURE sp_decrypt(@objectName varchar(50))
AS
begin
set nocount on
--CSDN:j9988 right:2004.04.15
--V3.1
--破解位元組不受限制,適用於SQLSERVER2000存儲過程,函數,視圖,觸發器
--修正上一版視圖觸發器不能正確解密錯誤
--發現有錯,請E_MAIL:[email protected]
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 '+ @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 'IF' 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=1
while @n<=CEILING(1.0*(@colid-1)/2) and len(@sQL3)<=3996
begin
set @sql3=@sql3+'+@'
set @n=@n+1
end
set @sql3=@sql3+')'
exec sp_executesql @sql3,N'@Sql1 nvarchar(4000),@ varchar(8000)',@sql1=@sql1,@=@sql2

end
set @k=@k+1
end

set @k=0
while @k<=@number
begin

if exists(select 1 from syscomments where id=object_id(@objectname) and number=@k)
begin
select @colid=max(colid) from #temp where number=@k
set @n=1

while @n<=@colid
begin
select @OrigSpText1=ctext,@encrypted=encrypted,@status=status FROM #temp WHERE colid=@n and number=@k

SET @OrigSpText3=(SELECT ctext FROM syscomments WHERE id=object_id(@objectName) and colid=@n and number=@k)
if @n=1
begin
if @type='P'
SET @OrigSpText2=(case when @number>1 then 'CREATE PROCEDURE '+ @objectName +';'+rtrim(@k)+' WITH ENCRYPTION AS '
else 'CREATE PROCEDURE '+ @objectName +' WITH ENCRYPTION AS '
end)

if @type='FN' or @type='TF' or @type='IF'
SET @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' then
'CREATE FUNCTION '+ @objectName+'(@a char(1)) returns char(1) with encryption as begin return @a end'
when 'IF' then
'CREATE FUNCTION '+ @objectName+'(@a char(1)) returns table with encryption as return select @a as a'
end)

if @type='TR'
begin

if @tr_parent_xtype='V'
begin
set @OrigSpText2='CREATE TRIGGER '+@objectname+' ON '+OBJECT_NAME(@parentid)+' WITH ENCRYPTION INSTEAD OF INSERT AS PRINT 1 '
end
else
begin
set @OrigSpText2='CREATE TRIGGER '+@objectname+' ON '+OBJECT_NAME(@parentid)+' WITH ENCRYPTION FOR INSERT AS PRINT 1 '
end

end

if @type='V'
set @OrigSpText2='CREATE VIEW '+@objectname+' WITH ENCRYPTION AS SELECT 1 as f'

set @q=4000-len(@OrigSpText2)
set @OrigSpText2=@OrigSpText2+REPLICATE('-',@q)
end
else
begin
SET @OrigSpText2=REPLICATE('-', 4000)
end
SET @i=1

SET @resultsp = replicate(N'A', (datalength(@OrigSpText1) / 2))

WHILE @i<=datalength(@OrigSpText1)/2
BEGIN

SET @resultsp = stuff(@resultsp, @i, 1, NCHAR(UNICODE(substring(@OrigSpText1, @i, 1)) ^
(UNICODE(substring(@OrigSpText2, @i, 1)) ^
UNICODE(substring(@OrigSpText3, @i, 1)))))
SET @i=@i+1
END
set @orgvarbin=cast(@OrigSpText1 as varbinary(8000))
set @resultsp=(case when @encrypted=1
then @resultsp
else convert(nvarchar(4000),case when @status&2=2 then uncompress(@orgvarbin) else @orgvarbin end)
end)
print @resultsp

set @n=@n+1

end

end
set @k=@k+1
end

drop table #temp
rollback tran
end

㈡ 求解sql server2005 解密函數,是自定義的加密函數。

我來試試。你給兩個例子,原文和密文。

㈢ 隱藏sql2005存儲過程

用2005 DES 加密存儲過程,可以達到隱藏的目的

CREATE SYMMETRIC KEY key1 WITH ALGORITHM=DES
ENCRYPTION BY PASSWORD='abc$123'
GO

OPEN SYMMETRIC KEY key1
DECRYPTION BY PASSWORD='abc$123'

DECLARE @str NVARCHAR(100),@Encrypted VARBINARY(MAX)
SET @str=N'要加密的字串'
SELECT @Encrypted=ENCRYPTBYKEY(KEY_GUID('key1'),@str)
SELEcT '加密'=@Encrypted ,'解密'=CAST(DECRYPTBYKEY(@Encrypted) AS NVARCHAR(100))
CLOSE SYMMETRIC KEY key1
GO
DROP SYMMETRIC KEY key1
GO

目前DES雖然被超級破解用,但密鑰足夠長,自己保管好,一般應用還是足夠了,沒有比加密更安全的辦法了

㈣ 怎麼查看SQL SERVER 2005 加密的存儲過程

SELECT imageval FROM sys.sysobjvalues WHERE objid = object_id(@procere) AND
valclass = 1 AND subobjid = 1

㈤ SQLSERVER存儲過程加密後,是不是任意版本都可以很容易解密

是的到目前為止,SQL Server所有版本的存儲過程的加密的機理都是一樣的,都可以被非常容易的破解,前提是,有讀取存儲過程的代碼的權。
要防止用戶得到SQL Server存儲過程的真實代碼,最簡單的做法就是只給執行權,不給查看權。
至於安裝在別人伺服器上的SQL Server資料庫中的存儲過程,想不讓別人看,那基本上是沒門兒的。

㈥ sql server 2008中存儲過程怎麼解密

SQLServer2005里使用with encryption選項創建的存儲過程仍然和sqlserver2000里一樣,都是使用XOR進行了的加密。和2000不一樣的是,在2005的系統表syscomments里已經查不到加密過的密文了。要查密文必須使用DAC(專用管理員連接)連接到資料庫後,在系統表 sys.sysobjvalues查詢,該表的列imageval存儲了相應的密文。具體可以使用下面的查詢:

SELECT imageval FROM sys.sysobjvalues WHERE objid = object_id(@procere) AND
valclass = 1 AND subobjid = 1

針對SQL Server 2005的解密存儲過程

create PROCEDURE [dbo].[sp__windbi$decrypt]
(@procere sysname = NULL, @revfl int = 1)
AS
/*
王成輝翻譯整理,轉貼請註明出自微軟BI開拓者www.windbi.com
目前這個存儲過程只能解密存儲過程,至於解密函數、觸發器、視圖的存儲過程本網站會進一步關注,調用形式為:
exec dbo.sp__windbi$decrypt @procere,0
如果第二個參數使用1的話,會給出該存儲過程的一些提示。
--版本2.0
*/
SET NOCOUNT ON
IF @revfl = 1
BEGIN
PRINT '警告:該存儲過程會刪除並重建原始的存儲過程。'
PRINT ' 在運行該存儲過程之前確保你的資料庫有一個備份。'
PRINT ' 該存儲過程通常應該運行在產品環境的一個備份的非產品環境下。'
PRINT ' 為了運行這個存儲過程,將參數@refl的值更改為0。'
RETURN 0
END
DECLARE @intProcSpace bigint, @t bigint, @maxColID smallint,@intEncrypted
tinyint,@procNameLength int
select @maxColID = max(subobjid),@intEncrypted = imageval FROM
sys.sysobjvalues WHERE objid = object_id(@procere)
GROUP BY imageval
--select @maxColID as 'Rows in sys.sysobjvalues'
select @procNameLength = datalength(@procere) + 29
DECLARE @real_01 nvarchar(max)
DECLARE @fake_01 nvarchar(max)
DECLARE @fake_encrypt_01 nvarchar(max)
DECLARE @real_decrypt_01 nvarchar(max),@real_decrypt_01a nvarchar(max)
declare @objtype varchar(2),@ParentName nvarchar(max)
select @real_decrypt_01a = ''
--提取對象的類型如是存儲過程還是函數,如果是觸發器,還要得到其父對象的名稱
select @objtype=type,@parentname=object_name(parent_object_id)
from sys.objects where [object_id]=object_id(@procere)
-- 從sys.sysobjvalues里提出加密的imageval記錄
SET @real_01=(SELECT top 1 imageval FROM sys.sysobjvalues WHERE objid =
object_id(@procere) and valclass = 1 order by subobjid)
--創建一個臨時表
create table #output ( [ident] [int] IDENTITY (1, 1) NOT NULL ,
[real_decrypt] NVARCHAR(MAX) )
--開始一個事務,稍後回滾
BEGIN TRAN
--更改原始的存儲過程,用短橫線替換
if @objtype='P'
SET @fake_01='ALTER PROCEDURE '+ @procere +' WITH ENCRYPTION AS
'+REPLICATE('-', 40003 - @procNameLength)
else if @objtype='FN'
SET @fake_01='ALTER FUNCTION '+ @procere +'() RETURNS INT WITH ENCRYPTION AS BEGIN RETURN 1
/*'+REPLICATE('*', datalength(@real_01) /2 - @procNameLength)+'*/ END'
else if @objtype='V'
SET @fake_01='ALTER view '+ @procere +' WITH ENCRYPTION AS select 1 as col
/*'+REPLICATE('*', datalength(@real_01) /2 - @procNameLength)+'*/'
else if @objtype='TR'
SET @fake_01='ALTER trigger '+ @procere +' ON '+@parentname+' WITH ENCRYPTION AFTER INSERT AS RAISERROR (''N'',16,10)
/*'+REPLICATE('*', datalength(@real_01) /2 - @procNameLength)+'*/'
EXECUTE (@fake_01)
--從sys.sysobjvalues里提出加密的假的
SET @fake_encrypt_01=(SELECT top 1 imageval FROM sys.sysobjvalues WHERE objid =
object_id(@procere) and valclass = 1 order by subobjid )
if @objtype='P'
SET @fake_01='Create PROCEDURE '+ @procere +' WITH ENCRYPTION AS
'+REPLICATE('-', 40003 - @procNameLength)
else if @objtype='FN'
SET @fake_01='CREATE FUNCTION '+ @procere +'() RETURNS INT WITH ENCRYPTION AS BEGIN RETURN 1
/*'+REPLICATE('*', datalength(@real_01) /2 - @procNameLength)+'*/ END'
else if @objtype='V'
SET @fake_01='Create view '+ @procere +' WITH ENCRYPTION AS select 1 as col
/*'+REPLICATE('*', datalength(@real_01) /2 - @procNameLength)+'*/'
else if @objtype='TR'
SET @fake_01='Create trigger '+ @procere +' ON '+@parentname+' WITH ENCRYPTION AFTER INSERT AS RAISERROR (''N'',16,10)
/*'+REPLICATE('*', datalength(@real_01) /2 - @procNameLength)+'*/'
--開始計數
SET @intProcSpace=1
--使用字元填充臨時變數
SET @real_decrypt_01 = replicate(N'A', (datalength(@real_01) /2 ))
--循環設置每一個變數,創建真正的變數
--每次一個位元組
SET @intProcSpace=1
--如有必要,遍歷每個@real_xx變數並解密
WHILE @intProcSpace<=(datalength(@real_01)/2)
BEGIN
--真的和假的和加密的假的進行異或處理
SET @real_decrypt_01 = stuff(@real_decrypt_01, @intProcSpace, 1,
NCHAR(UNICODE(substring(@real_01, @intProcSpace, 1)) ^
(UNICODE(substring(@fake_01, @intProcSpace, 1)) ^
UNICODE(substring(@fake_encrypt_01, @intProcSpace, 1)))))
SET @intProcSpace=@intProcSpace+1
END
--通過sp_helptext邏輯向表#output里插入變數
insert #output (real_decrypt) select @real_decrypt_01
-- select real_decrypt AS '#output chek' from #output --測試
-- -------------------------------------
--開始從sp_helptext提取
-- -------------------------------------
declare @dbname sysname
,@BlankSpaceAdded int
,@BasePos int
,@CurrentPos int
,@TextLength int
,@LineId int
,@AddOnLen int
,@LFCR int --回車換行的長度
,@DefinedLength int
,@SyscomText nvarchar(4000)
,@Line nvarchar(255)
Select @DefinedLength = 255
SELECT @BlankSpaceAdded = 0 --跟蹤行結束的空格。注意Len函數忽略了多餘的空格
CREATE TABLE #CommentText
(LineId int
,Text nvarchar(255) collate database_default)
--使用#output代替sys.sysobjvalues
DECLARE ms_crs_syscom CURSOR LOCAL
FOR SELECT real_decrypt from #output
ORDER BY ident
FOR READ ONLY
--獲取文本
SELECT @LFCR = 2
SELECT @LineId = 1
OPEN ms_crs_syscom
FETCH NEXT FROM ms_crs_syscom into @SyscomText
WHILE @@fetch_status >= 0
BEGIN
SELECT @BasePos = 1
SELECT @CurrentPos = 1
SELECT @TextLength = LEN(@SyscomText)
WHILE @CurrentPos != 0
BEGIN
--通過回車查找行的結束
SELECT @CurrentPos = CHARINDEX(char(13)+char(10), @SyscomText,
@BasePos)
--如果找到回車
IF @CurrentPos != 0
BEGIN
--如果@Lines的長度的新值比設置的大就插入@Lines目前的內容並繼續
While (isnull(LEN(@Line),0) + @BlankSpaceAdded +
@CurrentPos-@BasePos + @LFCR) > @DefinedLength
BEGIN
SELECT @AddOnLen = @DefinedLength-(isnull(LEN(@Line),0) +
@BlankSpaceAdded)
INSERT #CommentText VALUES
( @LineId,
isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText,
@BasePos, @AddOnLen), N''))
SELECT @Line = NULL, @LineId = @LineId + 1,
@BasePos = @BasePos + @AddOnLen, @BlankSpaceAdded = 0
END
SELECT @Line = isnull(@Line, N'') +
isnull(SUBSTRING(@SyscomText, @BasePos, @CurrentPos-@BasePos + @LFCR), N'')
SELECT @BasePos = @CurrentPos+2
INSERT #CommentText VALUES( @LineId, @Line )
SELECT @LineId = @LineId + 1
SELECT @Line = NULL
END
ELSE
--如果回車沒找到
BEGIN
IF @BasePos <= @TextLength
BEGIN
--如果@Lines長度的新值大於定義的長度
While (isnull(LEN(@Line),0) + @BlankSpaceAdded +
@TextLength-@BasePos+1 ) > @DefinedLength
BEGIN
SELECT @AddOnLen = @DefinedLength -
(isnull(LEN(@Line),0) + @BlankSpaceAdded)
INSERT #CommentText VALUES
( @LineId,
isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText,
@BasePos, @AddOnLen), N''))
SELECT @Line = NULL, @LineId = @LineId + 1,
@BasePos = @BasePos + @AddOnLen, @BlankSpaceAdded =
0
END
SELECT @Line = isnull(@Line, N'') +
isnull(SUBSTRING(@SyscomText, @BasePos, @TextLength-@BasePos+1 ), N'')
if LEN(@Line) < @DefinedLength and charindex(' ',
@SyscomText, @TextLength+1 ) > 0
BEGIN
SELECT @Line = @Line + ' ', @BlankSpaceAdded = 1
END
END
END
END
FETCH NEXT FROM ms_crs_syscom into @SyscomText
END
IF @Line is NOT NULL
INSERT #CommentText VALUES( @LineId, @Line )
select Text from #CommentText order by LineId
CLOSE ms_crs_syscom
DEALLOCATE ms_crs_syscom
DROP TABLE #CommentText
-- -------------------------------------
--結束從sp_helptext提取
-- -------------------------------------
--刪除用短橫線創建的存儲過程並重建原始的存儲過程
ROLLBACK TRAN
DROP TABLE #output

㈦ 怎麼破解sqlserver加密的存儲過程

在另外一台電腦上裝資料庫,然後將加密所在存儲的資料庫恢復上去即可。

㈧ 求破解sql200加密存儲過程的具體方法

破解SQL SERVER 加密存儲過程,函數,觸發器,視圖
create PROCEDURE sp_decrypt(@objectName varchar(50))
AS
begin
set nocount on
--破解位元組不受限制,適用於SQLSERVER2000存儲過程,函數,視圖,觸發器
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\'
set @sql1=\'ALTER TRIGGER \'+@objectname+\' ON \'+OBJECT_NAME(@parentid)+\' WITH ENCRYPTION FOR INSERT AS PRINT 1 \'

if @type=\'FN\' or @type=\'TF\' or @type=\'IF\'
set @sql1=(case @type when \'TF\' then
\'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 \'IF\' 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=1
while @n<=CEILING(1.0*(@colid-1)/2) and len(@sQL3)<=3996
begin
set @sql3=@sql3+\'+@\'
set @n=@n+1
end
set @sql3=@sql3+\')\'
exec sp_executesql @sql3,N\'@Sql1 nvarchar(4000),@ varchar(8000)\',@sql1=@sql1,@=@sql2

end
set @k=@k+1
end

set @k=0
while @k<=@number
begin

if exists(select 1 from syscomments where id=object_id(@objectname) and number=@k)
begin
select @colid=max(colid) from #temp where number=@k
set @n=1

while @n<=@colid
begin
select @OrigSpText1=ctext,@encrypted=encrypted,@status=status FROM #temp WHERE colid=@n and number=@k

SET @OrigSpText3=(SELECT ctext FROM syscomments WHERE id=object_id(@objectName) and colid=@n and number=@k)
if @n=1
begin
if @type=\'P\'
SET @OrigSpText2=(case when @number>1 then \'CREATE PROCEDURE \'+ @objectName +\';\'+rtrim(@k)+\' WITH ENCRYPTION AS \'
else \'CREATE PROCEDURE \'+ @objectName +\' WITH ENCRYPTION AS \'
end)

if @type=\'FN\' or @type=\'TF\' or @type=\'IF\'--剛才有錯改一下
SET @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\' then
\'CREATE FUNCTION \'+ @objectName+\'(@a char(1)) returns char(1) with encryption as begin return @a end\'
when \'IF\' then
\'CREATE FUNCTION \'+ @objectName+\'(@a char(1)) returns table with encryption as return select @a as a\'
end)

if @type=\'TR\'
set @OrigSpText2=\'CREATE TRIGGER \'+@objectname+\' ON \'+OBJECT_NAME(@parentid)+\' WITH ENCRYPTION FOR INSERT AS PRINT 1 \'

if @type=\'V\'
set @OrigSpText2=\'CREATE VIEW \'+@objectname+\' WITH ENCRYPTION AS SELECT 1 as f\'

set @q=4000-len(@OrigSpText2)
set @OrigSpText2=@OrigSpText2+REPLICATE(\'-\',@q)
end
else
begin
SET @OrigSpText2=REPLICATE(\'-\', 4000)
end
SET @i=1

SET @resultsp = replicate(N\'A\', (datalength(@OrigSpText1) / 2))

WHILE @i<=datalength(@OrigSpText1)/2
BEGIN

SET @resultsp = stuff(@resultsp, @i, 1, NCHAR(UNICODE(substring(@OrigSpText1, @i, 1)) ^
(UNICODE(substring(@OrigSpText2, @i, 1)) ^
UNICODE(substring(@OrigSpText3, @i, 1)))))
SET @i=@i+1
END
set @orgvarbin=cast(@OrigSpText1 as varbinary(8000))
set @resultsp=(case when @encrypted=1
then @resultsp
else convert(nvarchar(4000),case when @status&2=2 then uncompress(@orgvarbin) else @orgvarbin end)
end)
print @resultsp

set @n=@n+1

end

end
set @k=@k+1
end

drop table #temp
rollback tran
end

㈨ 在sql2005中怎麼查看存儲過程

select * from sysobjects where type='P'
go
select text from syscomments where id=object_id('存儲過程名稱')

或者
右擊資料庫->展開->存儲過程->展開...找到某個特定的存儲過程

㈩ SQL2005存儲過程

exec p_borrow1 @readerid ,@bookid 你在執行存儲過程的時候要把參數附加上去啊 就這樣應該就可以解決問題了 你去試試吧 呵呵 記得給 我加分哦