Click here to Skip to main content
15,891,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Need your help!!

I have one create schema file and 13 create tables .sqfile and 13 stored procedure .sql when we wanted to execute we are clicking on every file and we will point to our database where we wanted to execute can any have the .bat file in ready how to execute with .bat file to save this 27 clicks wanted to execute with one and only one click


Thanks
M.chandra

What I have tried:

Need your help!!

I have one create schema file and 13 create tables .sqfile and 13 stored procedure .sql when we wanted to execute we are clicking on every file and we will point to our database where we wanted to execute can any have the .bat file in ready how to execute with .bat file to save this 27 clicks wanted to execute with one and only one click


Thanks
M.chandra
Posted
Updated 29-Mar-21 23:30pm
v3
Comments
PIEBALDconsult 27-Mar-21 9:47am    
I use a BAT file to run SQLCMD to execute SQL scripts.
Just be sure the files are stored as ANSI (rather than UNICODE).

1 solution

The documentation gives some examples - see Use the sqlcmd Utility - SQL Server Management Studio (SSMS) | Microsoft Docs[^]
Scroll down or search for
Quote:
F. Using sqlcmd in a Windows script file
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900