如何从 TSQL 编写存储过程脚本 [英] How to script a stored procedure from TSQL
本文介绍了如何从 TSQL 编写存储过程脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道有一种方法可以做到这一点,就像我看到的那样 - 我只是不记得是怎么做的.
I know there's a way to do this as I've seen it done - I just can't remember how.
我想运行一个 SQL 命令,该命令将返回用于创建存储过程的脚本.
I want to run a SQL command which will return the script to create the stored procedure as a result.
我该怎么做?
推荐答案
尝试使用 sp_helptext 命令:
Try using sp_helptext command :
sp_helptext 'yourprocname'
或使用 object_definition :
or using object_definition :
SELECT OBJECT_DEFINITION(OBJECT_ID('yourprocname'))
这篇关于如何从 TSQL 编写存储过程脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文