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.
December 19, 2000
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.
About the Author
You May Also Like