run a external program from a trigger

Hi all...

I m trying to run an external program through a trigger on data modification... But it is not perofrming the required function.. even it is not giving any error..

'''''''''''''''''''''
CREATE TRIGGER try1_trigger
ON try1
FOR INSERT, UPDATE, DELETE
AS
 DECLARE @sCmd varchar(256)
 EXEC master.dbo.xp_cmdshell  'C:\winnt.sbs\notepad.exe'
''''''''''''''''


please let me know where i m wrong...

thanx
LVL 22
neeraj523Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
nigelrivettConnect With a Mentor Commented:
notepad opens a window and requires user interaction to close it so it will be waiting for that.

try something like a make directory command to test.
(not keen on running exe's from triggers, good way of crashing a system).
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
i agree with nigelrivett
0
 
neeraj523Author Commented:

Thanx nigelrivett for your valuable suggustion...
0
All Courses

From novice to tech pro — start learning today.