开发者

How could i get the content of a stored procedure using sql query

开发者 https://www.devze.com 2023-01-20 19:36 出处:网络
I need to get th开发者_如何学Goe content (statements) of a stored procedure on databaseAand in serverA,

I need to get th开发者_如何学Goe content (statements) of a stored procedure on databaseA and in serverA,

I am using SQL Server


use databaseA
go
sp_helptext 'YourProcedure'
go


Select Routine_name, Routine_Definition
From Information_Schema.Routines
Where Routine_Name = "YourStoredProcedureName"


use DATABASE_NAME

select [name], [text]
from sysobjects SO join syscomments SC
on SO.id = SC.id
where xtype = 'P'
0

精彩评论

暂无评论...
验证码 换一张
取 消