Sunday, 11 August 2013

SQL Helper

Problem: I need to to give a user permission to run all stored procs on a specific database.

Resolution:
This is not relevant to SharePoint but I had to look up how to give windows users or groups access to run all stored procs in a database.  User will still need the underlying permissions to work on the database.  I create the "sp_executor" role for executing all stored procs on the db.
T-SQL:

CREATE LOGIN [gstt\pbeck] FROM WINDOWS;
use PBTransDB
GO
CREATE ROLE sp_executor
GO
GRANT EXECUTE TO sp_executor
GO
CREATE USER pbeck FOR LOGIN "demo\pbeck"
GO
EXEC sp_addrolemember 'sp_executor', 'pbeck'
GO



 

0 comments:

Post a comment