February 27, 2002 at 10:36 am
Hi All,
I've this problem, I need to watch 1 table. Whenever there is new insert to the table, I need to execute a system command (CmdExec). I tried using trigger on the watch table, but you can only use T-SQL stmts in trigger.
any ideas???
Thanks
Ku
February 27, 2002 at 12:12 pm
A couple solutions:
1. Insert a value in a table using a trigger. Run a DTS package every 10 sec, check for new values and run the command
2. Use master..xp_cmdshell. It will allow you to run OS commands.
Steve Jones
February 27, 2002 at 3:37 pm
Steve,
in option 2, you mean I can use the EXEC master..xp_cmdshell 'command ...' within the trigger on the watch table, correct?
I think I'm close!
February 27, 2002 at 4:37 pm
you will have to be careful about permissions and for that reason I would not do it, but yes, you can
create trigger mytrigger on mytable for insert
as
exec master..xp_cmdshell 'dir c:'
Steve Jones
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply