Home > Blockchain >  How you run all SQL scripts automatically from executable
How you run all SQL scripts automatically from executable

Time:01-18

I have a folder with all the SQL scripts in the project.

I need to create a script that automatically on click executes all the scripts in the folder in Microsoft SQL Server Management Studio.

An executable that automatically loops and executes all scripts in the folder

CodePudding user response:

for %%G in (*.sql) do sqlcmd /S servername /d databasename -i"%%G"

PAUSE

Creates a file in the folder like name.bat/Enter this code and save/Click the file

  • Related