我需要在数据库和serverA中获取存储过程的内容(语句),
我正在使用SQL Server
答案 0 :(得分:3)
use databaseA
go
sp_helptext 'YourProcedure'
go
答案 1 :(得分:1)
Select Routine_name, Routine_Definition
From Information_Schema.Routines
Where Routine_Name = "YourStoredProcedureName"
答案 2 :(得分:1)
use DATABASE_NAME
select [name], [text]
from sysobjects SO join syscomments SC
on SO.id = SC.id
where xtype = 'P'