I would like to run bunch of sql files on particular database using either batch file or C# program. How to achive this? I tried below batch file code but no luck. The folder could be anywhere in my computer. Please do assist.
for %%G in (*.sql) do sqlcmd /S servername /d databaseName -E -i"%%G"
c:\>for %f in (*.sql) do sqlcmd /S <servername> /d <dbname> /E /i "%f"