SqlServer 打印存储过程

方法一: 

declare @p_text varchar(max)
SELECT @p_text= definition FROM sys.sql_modules 
JOIN sys.objects ON sys.sql_modules.object_id=sys.objects.object_id --and type='P' 
and sys.objects.name='proc_user_list' 

print @p_text

方法二: 

exec sp_helptext 'proc_user_list'

猜你喜欢

转载自blog.csdn.net/qq_32109957/article/details/82985493