首页 > 开发 > 综合 > 正文

根据SQL存储过程名取得存储过程的内容

2024-07-21 02:42:11
字体:
来源:转载
供稿:网友
根据SQL存储过程名取得存储过程的内容:

示例如下:(此语句适用于SQL Server2000/2005)

SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GO--     GetContentByPRocedureName '[dbo].[存储过程名]'Create procedure GetContentByProcedureName(@ProcedureName nvarchar(500))as if exists (select * from dbo.syscomments where id=object_id(N''+@ProcedureName+'')) select c.text, c.encrypted, c.number, xtype=convert(nchar(2), o.xtype),     datalength(c.text), convert(varbinary(8000), c.text), 0 from dbo.syscomments c, dbo.sysobjects o   where o.id = c.id and c.id = object_id(N''+@ProcedureName+'') order by c.number, c.colid option(robust plan)GOSET QUOTED_IDENTIFIER OFF GOSET ANSI_NULLS ON GO

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表