Can anyone help me write a script to run all of the SQL files in a particular folder?
I need to deploy a bunch of Stored Procedures and I want to deploy them all at once without having to manually run each one. We run Microsoft SQL Server 2005.
|
Can anyone help me write a script to run all of the SQL files in a particular folder? I need to deploy a bunch of Stored Procedures and I want to deploy them all at once without having to manually run each one. We run Microsoft SQL Server 2005. | |||
|
feedback
|
|
Windows command line processor support the for statement, so you can create a
This will process all Reference: Microsoft Windows XP - For Also, you can specify the database directly in the script using at the beginning:
The | |||||
feedback
|
|
If you need to run them in a particular order then the best solution is just to write a
| |||||
feedback
|
|
I'm not 100% sure that sqlcmd can accept a wildcard, but try:
| |||
|
feedback
|