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'
精彩评论