• subscribe
December 20, 2000 12:00 AM

Tip: Executing OS Commands from OSQL or ISQL

SQL Server Pro
InstantDoc ID #16313

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:\temp\test.txt d:\temp\test2.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.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here