Solved

run a external program from a trigger

Posted on 2001-06-04
3
228 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:neeraj523
3 Comments
 
LVL 18

Accepted Solution

by:
nigelrivett earned 50 total points
ID: 6152090
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6152297
i agree with nigelrivett
0
 
LVL 22

Author Comment

by:neeraj523
ID: 6155165

Thanx nigelrivett for your valuable suggustion...
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question