Run DOS command from SQL

  • After I run my T-SQL command to export a table, I want to run a commandline to comress my flat file.

    Is that possible? If so, can someone give me an example?

    I sure I can do it in SSIS but all I am doing is exporting from a SQL command and want to comress the file using a DOS commandline, that's it.

    Using SSIS for this would be like using a chainsaw to slice my watermellon.

    Thanks

    Gene Laoyan

  • You could do this using xp_cmdshell this is disabled by deafult on SQL Server 2005 on new installs so you would need to turn it on before you could use it. You can do this using the SAC tool. References on how to use xp_cmdshell can be found in BOL.

    hth

    David

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply