Tip: Executing OS Commands from OSQL or ISQL

For simple OS-level batch file processing, OSQL and ISQL can quickly and effectively meet your needs.

Brian Moran

December 19, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

Data Transformation Services (DTS) and SQL Agent provide powerful means of scripting complex jobs, but for simple OS-level batch file processing, OSQL and ISQL can quickly and effectively meet your needs. OSQL and ISQL can even execute OS commands when you begin the command sequence with double exclamation points (!!). For example, you can use the command

!! copy d:temptest.txt d:temptest2.txt

in an ISQL batch or interactive session to issue an OS-level copy command. This example is basic, but you could just as easily use the !! command sequence to execute an FTP session or a complex Windows Script Host (WSH) command file from an OSQL or ISQL session.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like