Running an EXE from T-SQL

  • Can anyone please tell me how I can launch and EXE after the completion of a SQL script. I thought that there was a SP that would allow me to do this, however I can't remember the SP or syntax.

    Many thanks.

    -Joe

  • master..xp_cmdshell will let you run host commands from QA/ISQL/OSQL. Be careful not to run things that will pop up a dialog box or prompt for input because it'll just hang there.

    eg. exec master..xp_cmdshell 'time'

    ...will just hang there, whereas:

    exec master..xp_cmdshell 'time /t'

    ...will return some good info.


    Cheers,
    - Mark

  • Note however that it is recommended that this XProc is disabled in a production environment.. it is a bit of a security hole

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

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