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.

3
  • hi, welcome to StackOverflow! Please take the tour here: stackoverflow.com/tour Commented Nov 28, 2014 at 10:39
  • Open them all in SSMS and run them one by one? Commented Nov 28, 2014 at 10:46
  • mordack -Please tell once if know answer Commented Nov 28, 2014 at 10:51

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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

2 Comments

please give query for sql
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?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.