MSPSS: is there life after the helpdesk?

sharing solutions to uncommon IT problems

T-SQL: Grant access rights to enable a user to send email with SP_OACreate

leave a comment »


I know, it is not the best practice and it will be soon discontinued by MS but it is good if you, like me, have many legacy apps and no time to do what’s right (update the code).

Here’s the script to grant the necessary rights (remember to grant public access to the user before executing the script:

GRANT EXECUTE ON sp_OASetProperty TO UserX;
GO
GRANT EXECUTE ON sp_OASetProperty TO UserX;
GO
GRANT EXECUTE ON sp_OAGetErrorInfo TO UserX;
GO
GRANT EXECUTE ON sp_OAMethod TO UserX;
GO
GRANT EXECUTE ON sp_OASetProperty TO UserX;
GO
GRANT EXECUTE ON sp_OACreate TO UserX;
GO
GRANT EXECUTE ON sp_OADestroy TO UserX;
GO

Advertisements

Written by zantoro

September 5, 2012 at 1:58 pm

Posted in SQL Server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: