SQL Server Development Bookmark and Share   
 index > SQL Server Security > Trigger over web permission problem
 

Trigger over web permission problem

There is my scenario:

I have SQL Server Standard.
I made a trigger that everytime I insert new data on my table, sends a mail to my outlook account.
There is no problem
using Management studio

I did dynamic data web site (Visual studio 2008) where users can insert/delete/update different tables using internet esplorer but, when they try to insert some data there is no way to do that.
There is no problem inserting data on other tables wich do not have any trigger.

The reason why they can't insert data is due that trigger can't send mail and I receive the following error message:

SQL blocked the access to dbo.sp_send_mail of the component 'Database Mail XPs' because this component is disabled.

I did sp_configure and fixed the value of
'Database Mail XPs' to 1 but it stills not working and I receive the same error.

I gave execute, insert, select, update, alter, delete and connect permissions on msdb and on my db to users ASPNET and GUEST.

Finally I changed the connection string of my web and connected as sa but it stills not working.

If somebody knows or have some new idea I will thank.

See you.
COMB  Thursday, December 11, 2008 12:59 PM

Moving thread, you get better assist in Security Forum.

Xinwei Hong - MSFT  Thursday, December 11, 2008 10:30 PM

I am including a link that may provide useful information:

ยท Troubleshooting Database mail: General steps (http://msdn.microsoft.com/en-us/library/ms187540.aspx)

I hope this information helps,

-Raul Garcia

SDE/T

SQL Server Engine

Raul Garcia - MS  Friday, December 12, 2008 2:12 AM
It sounds as though DB Mail isn't configured on the server. Remove the permissions you granted to those accounts and then run the DB Mail Wiard:
In SSMS connect to the server, exapnd it, expand "Management", then right-click "Database Mail" and select "Configure Database Mail". Follow the prompts and then test it to create a profile that works for your setup.
Check the trigger code to see if it calls a specific dbmail profile and if so; ensure one exists by creating it or modifying the one you just setup. If one is not specifiec ensure the profile you just created is "public" and is the "Default profile".

Once that's done add the account that will fire the trigger to the "DatabaseMailUserRole" in msdb.

Cheers!
  • Proposed As Answer byA.Lockwood Tuesday, December 16, 2008 11:11 PM
  •  
A.Lockwood  Tuesday, December 16, 2008 11:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Add member failed for DatabaseRole Learning Role for 'dbo'
• Permissions to run Import Export functions without giving access to ALL Master or MSDB database
• SQL 2005 Security - Schema & Username... very annoying
• Windows Firewall altering my settings
• Security in hosted database servers
• Error 18456 State 11 -- login failed for wrong user
• Change dbo login name
• Error: 18456, Severity: 14, State: 8 over and over in SQL Server Log
• I forgot my SA password for my instance of SQL 2000
• Error from changing service account