I have a bunch of written sql scripts that I have written and I was looking to run as a batch in order in a folder. After reading up I've resorted to creating a bat file which includes using the sqlcmd. For this particular set of scripts, when i run the bat it doesn't seem to run in order. I have no idea what is going on as I've tried renaming the sql scripts numerically with a prefix number in the beginning, tried using letters, and even renaming the whole script to just a number/letter using windows explorer.
The process might look something like this A.sql - B.sql - C.sql - D.sql - F.sql - G.sql - E.sql
Any ideas as to what I am missing or how i am renaming these files incorrectly? Thanks
what I have in my bat file
for %%G in (*.sql) do sqlcmd /S W-VAN-A124178\HAZUSPLUSSRVR /d
BC_Exposure_2016 -E -i"%%G"
pause