创建所有Sql过程脚本 [英] Creating all Sql procedure script

查看:84
本文介绍了创建所有Sql过程脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想创建特定数据库的所有过程的脚本
与:

Hi

I want to create script of all procedures of a particular database
with :

"IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp.Name]') AND type in (N'P', N'PC'))"
Drop procedure [dbo].[sp.Name]
Create proc [dbo].[sp.Name]


然后
与下一个步骤相同"

格式:
在单个.sql文件中.
我已经使用了很多方法来执行此操作,但是我没有得到
正确的格式


then
"Same for next procedure "

format:
In A single .sql file.
I have use so many way of doing this but I did not get
the proper format

推荐答案

在您的 Sql Server Management Studio中:

右键单击您的数据库
然后转到任务-> 生成脚本
然后选择特定数据库对象和选择存储过程.

然后将其保存到单个文件.
In your Sql Server Management Studio :

Right click on Your Database
then go to Tasks -> Generate Scripts
then Select Specific Database Objects & select Stored Procedures.

Then save it to single file.


这篇关于创建所有Sql过程脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆