How to deploy the SQL scripts to the local database (one-click deployment)? How to deploy the SQL scripts to the local database (one-click deployment)?

On a periodic interval, we receive .sql files from Developers. I will have to automate the process of pushing all .sql files to mapped database.

I am trying to get some help on osql / batch script syntax to deploy .sql files.
I think you can get your answer from this link: 

https://stackoverflow.com/questions/2583517/run-all-sql-files-in-a-directory

You can also check below site for more details on SQLCMD utility:

https://ssqlforest.wordpress.com/2016/10/31/how-to-use-sql-server-database-from-sqlcmd-prompt/



You can use database name within the script or -d option if all scripts have to go in the same database. Kindly ensure that queries are separated in batch i.e. go keyword after each SQL statement.