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 |
checkout
Starting Member
2 Posts |
Posted - 2010-11-16 : 10:24:30
|
Hello world,I'am trying to make a trigger that has to call a stored procedure when a tabel is updated.The nect example is working without any problems:EXEC master.dbo.xp_sendmail @recipients = N'test@test.nl', @query = N'SELECT * FROM INFORMATION_SCHEMA.TABLES', @subject = N'SQL Server Report', @message = N'The contents of INFORMATION_SCHEMA.TABLES:', @attach_results = 'TRUE', @width = 250 ;I have made the following stored procedure. This has to send a email:CREATE PROCEDURE [dbo].[send_mail] ASexec master.dbo.xp_sendmail@recipients='test@test.nl',@subject='test'GOThis i wanted to call from the following trigger:CREATE TRIGGER [XML_trigger] ON [dbo].[XMLEvents] FOR INSERTASEXEC send_mailBut it is giving me the following error from SQL:[Microsoft][ODBC SQL Server Driver][SQL Server]EXECUTE permission denied on opbject 'xp_sendmail', database 'master', owner 'dbo',SQL State:42000DB error:229I can not figure out where this is going wrong. Because teh SP (xp_sendmail) is working fine from the Query Analyzer.Please help to find out the solluition... |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|