April 25, 2017 at 9:37 am
SQL Server 2012 . I have set up a profile and account.
use msdb
GO
EXEC sp_send_dbmail
@profile_name='adminprofile@abc.com',
@recipients='user1@abc.com',
@subject='Test message',
@body='This is the test body'
I ran the code and I am the sysadmin in the server . I get the following error in the event viewer
The update to the database failed. Reason: The EXECUTE permission was denied on the object 'sysmail_logmailevent_sp', database 'msdb', schema 'dbo'.
April 25, 2017 at 9:45 am
That would suggest you aren't a sysadmin, if you're getting write permissions. What does the below return:SELECT sysadmin
FROM master.sys.syslogins
where name = SYSTEM_USER;
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
April 25, 2017 at 9:49 am
Thom A - Tuesday, April 25, 2017 9:45 AMThat would suggest you aren't a sysadmin, if you're getting write permissions. What does the below return:SELECT sysadmin
FROM master.sys.syslogins
where name = SYSTEM_USER;
Returns 1
April 25, 2017 at 10:56 am
EXEC sp_helpsrvrolemember 'sysadmin'
Sue
April 25, 2017 at 11:02 am
Sue_H - Tuesday, April 25, 2017 10:56 AMIs the service account for SQL Server Agent in the sysadmins role?
Try running the following and see if there is a local windows group in sysadmins role for the service account:EXEC sp_helpsrvrolemember 'sysadmin'
Sue
Yes it is.
NT SERVICE\SQLSERVERAGENT
April 25, 2017 at 11:10 am
I also added NT SERVICE\MSSQLSERVER to the sysadmin role and it worked , I am not getting the previous permission to execute error now.
April 25, 2017 at 11:14 am
Guras - Tuesday, April 25, 2017 11:10 AMI also added NT SERVICE\MSSQLSERVER to the sysadmin role and it worked , I am not getting the previous permission to execute error now.
But I do not understand the solution 🙁
April 25, 2017 at 11:25 am
Guras - Tuesday, April 25, 2017 11:14 AMGuras - Tuesday, April 25, 2017 11:10 AMI also added NT SERVICE\MSSQLSERVER to the sysadmin role and it worked , I am not getting the previous permission to execute error now.But I do not understand the solution 🙁
Most likely, you made changes outside of Configuration Manager to end up with those issues. The groups, roles, permissions in SQL Server as well as the operating system are all managed when using Configuration Manager. Even using the Services app is a bad idea.
You could check the groups on the server and make sure the correct accounts are in both of the groups.
How the permissions and different accounts work is documented here:
Configure Windows Service Accounts and Permissions
Sue
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply