查看存储过程定义

查看存储过程定义

方法1.系统存储过程: sp_helptext

USE AdventureWorks2012;  
GO  
EXEC sp_helptext N'AdventureWorks2012.dbo.uspLogError';

方法2.系统函数:OBJECT_DEFINITION

USE AdventureWorks2012;  
GO  
SELECT OBJECT_DEFINITION (OBJECT_ID(N'AdventureWorks2012.dbo.uspLogError'));

方式3.sys.sql_modules 目录视图: sys.sql_modules

USE AdventureWorks2012;  
GO  
SELECT definition  
FROM sys.sql_modules  
WHERE object_id = (OBJECT_ID(N'AdventureWorks2012.dbo.uspLogError'));

 

posted @ 2020-04-01 22:52  Vincent-yuan  阅读(539)  评论(0编辑  收藏  举报