Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How you run all SQL scripts automatically from executable

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading