How do I grant execute permission on sp_oacreate in the master db?

Hi everyone
I am trying to run the sp_oacreate master procedure from within a trigger on a sql 2005 database table. So far the only solution i have found that works is to add my database role and user roles just as they are in my current database to the master database as well. I am using NT authentication.

The error I'm getting when i update the table with the trigger in vb is:
42000: [Microsoft][ODBC SQL Server Driver][SQL Server]EXECUTE permission denied on object 'sp_OACreate', database 'mssqlsystemresource', schema 'sys'.

Any help would be appreciated
Effie
tiseffiesAsked:
Who is Participating?
 
DantheDBACommented:
Using the sysadmin fixed server role will allow access to these SPs, but is generally a bad idea due to the security risks. You may consider an alternate approach such as a certificate.

In any case to add a login to the server level sysadmin role execute the following:

use master
exec sp_addsrvrolemember 'loginname', 'sysadmin'

Contrary to rboyd56's statement, it is possible (I have done it successfully myself)  to grant permissions on these system stored procedures to a user that is not a member of the sysadmin role. Run the following to grant the group of system stored procedures to a specific username

use master
grant exec on sp_OACreate to username
grant exec on sp_OAGetErrorInfo to username
grant exec on sp_OAMethod to username
grant exec on sp_OAGetProperty to username
grant exec on sp_OADestroy to username

You will want to map the existing login for your username to a user in Master because the permission cannot be directly addressed to the login.

Thanks,
Dan
0
 
SireesCommented:
For you to execute the sp_oacreate stored procedures you need to be in the system admin group, or you can go into master database and give your self exec permissions on each procedure in extend stored procedures section.

use master
go

grant exec on sp_OACreate to yourUserLogin
GO

0
 
rboyd56Commented:
According to Books on Line and y persona experience sirees is correct that you ahve to be a sysamin in order to rus sp_oacreate. However, I do not believe you can grant execute on that procedure to other users that are not members of the sysadmin role.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
tiseffiesAuthor Commented:
Yes I know of the sysadmin mentioned. Though I'm not sure how to do that in sql2005.
The other thing is this would be rejected by my client because it would pose a security issue... messing around with the master database. So i was hoping to use another method.. Unfortunately i'm stuck for ideas.

thanks for you reply
0
 
tiseffiesAuthor Commented:
To All

I have completed this task finally, I had to give guest permission to the above sp's, apparently mandatory when referencing a second database with an Application role connection on the first.
0
 
kworksCommented:
@tiseffies:

Since I'm having similar problem, I'm just wondering about the sentence "give guest permission to the above sp's". What would that be, precisely?

And, if that is the case, what is the difference between it and the accepted solution??

Your help is much appreciated.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.