In the directory 'C:\scripts' I am having script files in '.sql' format.How to execute all these files at the time using sql query from my SQL SERVER MANAGEMENT STUDIO.
-
hi, welcome to StackOverflow! Please take the tour here: stackoverflow.com/tourEduard Uta– Eduard Uta2014-11-28 10:39:17 +00:00Commented Nov 28, 2014 at 10:39
-
Open them all in SSMS and run them one by one?mordack550– mordack5502014-11-28 10:46:41 +00:00Commented Nov 28, 2014 at 10:46
-
mordack -Please tell once if know answerSaravana Kumar– Saravana Kumar2014-11-28 10:51:32 +00:00Commented Nov 28, 2014 at 10:51
Add a comment
|
2 Answers
If this linked post contains the info you need then I suggest marking your post as duplicate of the linked one: Run all SQL files in a directory
Otherwise, check if this helps: http://www.sql-server-helper.com/tips/execute-sql-scripts-batch.aspx
Comments
make a batch file with anyname.bat and save it in the same directory, save it and run it.
this sample of mysql
@ECHO OFF
ECHO Running scripts
FOR %%i IN (*.sql) DO mysql -uroot -proot databasename< %%i
ECHO Finished!
pause
2 Comments
Saravana Kumar
please give query for sql
Sindhoo Oad
sql is Structured Query Language, it is used to query your database not to run
.sql files placed somewhere in your system. what is the need to do so?