0

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.

Eduard Uta
  • 2,477
  • 5
  • 26
  • 36

2 Answers2

1

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

Community
  • 1
  • 1
Eduard Uta
  • 2,477
  • 5
  • 26
  • 36
0

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
Sindhoo Oad
  • 1,194
  • 2
  • 13
  • 29