Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Dennis Falls
Starting Member
41 Posts |
Posted - 2005-08-23 : 16:54:52
|
I am trying to use xp_cmdshell as followsCREATE TRIGGER trg_rptAdminTestON tblTestAFTER INSERTAS Exec master.dbo.xp_cmdshell 'dtsrun /S MyServer /N TestNewUser /E'declare @rc intExec @rc = master.dbo.xp_smtp_sendmail @FROM = 'Me@MyHost.com', @TO = 'You@YourHost.com', @subject = 'New User Request', @attachments = 'E:\NewUsers\NewUserTest.txt', @message = 'There is a request for a new user account. See attached file for details.', @server = 'smtpserver.com'select RC = @rcGOI can run it without the trigger in query analyzer and I can run it from the trigger if I comment out Exec master.dbo.xp_cmdshell 'dtsrun /S MyServer /N TestNewUser /E'But if I leave the statement intact and try to do an insert into the table containing the trigger, everything hangs to the point I have to stop sql server service to get it to break loose.I think I have all the permissions set. What else should I be looking for? |
|
|
|
|