Run SQL from Batch File using SQLCMD

The sqlcmd utility lets you enter Transact-SQL statements, system procedures, and script files through a variety of available modes: At the command prompt. In Query Editor in SQLCMD mode. In a Windows script file. In an operating system (Cmd.exe) job step of a SQL Server Agent job. The utility uses ODBC to execute Transact-SQL batches. Run sql from command... » read more

Windows Batch Script Example

In Windows, the batch file is a file that stores commands in a serial order. Command line interpreter takes the file as an input and executes in the same order. A batch file is simply a text file saved with the .bat or .cmd file extension. It can be written using Notepad or any other... » read more