Mihai C.
September 20th, 1999, 02:26 AM
How can I execute an exe-file from an SQL command?
Or how I do thie from SQL-Server? Something like a
trigger, but to execute a exe-file, not a stored procedure.
LHFerrari
September 20th, 1999, 05:02 PM
Hi
Refer to 'sp_runtask' and 'SQL Executive' documentation.
With 'sp_runtask' you can execute a previous created 'SQL Executive Task' that can be a 'CmdExec'.
HIH
September 20th, 1999, 07:06 PM
exec @ret_status = master..xp_cmdshell 'name of your program'
Example: xp_cmdshell 'copy c:\file.txt d:\bkup\file.txt'
This will display the result from the program/DOS Command as a result-set. It returns the exit code of the program.