Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
BalakrishnanShanmugham
Starting Member
6 Posts |
Posted - 2015-04-08 : 04:44:01
|
I have separate scripts for Creation of Tables, Stored Procedures, Views, Triggers in different .sql files.I have to execute thses scripts in batch in different servers and different databases without opening SSMS.All .sql files to be executed in single command.Please suggest how to achieve?Appreciate your help.Regards,Bala |
|
Kristen
Test
22859 Posts |
Posted - 2015-04-08 : 04:50:21
|
We use a BATCH file and the command line program SQLCMD e.g. something like thisSQLCMD -d MyDatabaseName -i MyScriptName.SQL -o C:\MyPath\MyScriptName.OUT -b -l 300 -S . -E >>C:\MyPath\MyScriptName.LOG |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
|
|
|
|