Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch external prggram for stored procedure?

Status
Not open for further replies.

Kieninger

Programmer
Dec 20, 2001
4
US
Set up a function to launch an application from triggered stored procedure. For instance, a record is has a status field set to "completed" and that triggers an app to start up and send information off to someplace else. Or, I guess, could be a message to another application.
 
ok, xp_cmdshell
Are there constraints on what type of external programs can be launched?

As a simply test I tried this in a insert trigger

master.dbo.xp_cmdshell "notepad"

When I insert a record, not only doesn't notepad start, sql server get hosed.

What am I missing? The book on-line don't point to the problems.

Thanks
 

There are limitations in the types of programs you can and should start with xp_cmdshell. You don't want to start anything with a user interface such as Notepad. Notepad requires keyboard input which SQL cannot provide.

What kind of info do you want to send? Are you sending info to another application, database or user? Have you considered xp_sendmail? xp_sendmail allows you to send email from SQL Server with attachments, query results, etc. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top