开发者

What is the easiest way of executing a series of T-SQL scripts sequentially without the command prompt?

I am not allowed to use command prompt, unfortunately.

Currently I use SQL Server Management Studio, but I could switch to VS2010, if it was easier there.

Running a set of scripts in a specific order, especially when doen manual开发者_如何学Cly, is a bit tedious.

Thank you very much for any suggestions you might have.


You can edit and run SQL scripts in SSMS if this helps

You can use :r filename.sql command in the SQLCMD script command to execute a sql script

:r first.sql
:r second.sql


One method would be to create a job with no schedule, then you can run it manually. Each step in the job could be one of your scripts.

The benefit of using a job would be that you could set up alerting and get an email if any step failed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜