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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_cmdshell

Status
Not open for further replies.

sbdt

MIS
Oct 23, 2002
17
I am trying to create a custom error message to be used with a trigger. I created a VB 6.0 app that displays a message box "this is an error." The trigger is as follows:
CREATE TRIGGER Test
ON [dbo].[IMITMIDX_SQL]
FOR UPDATE
AS

exec master.dbo.xp_cmdshell 'start d:\macappssql\temp\project1.exe'

When I execute this trigger using my application, I am apparently causing an endless loop or something similar, as nothing apparently happens, but I completely freeze up if I attemt to make any changes to the trigger.
start d:\macappssql\temp\project1.exe works fine from a command prompt, but does not seem to work from xp_cmdshell. Any suggestions on what I am doing wrong would be appreciated.
 
Think about this. Where does the pop-up box appear? When you run xp_cmdshell, the application being called is run on the SQL Server by the SQL Server process.
 
And because the popup is on the SQL Server's console the trigger can not complete until someone on the server's console click's the ok button.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top