axnst2
asked on
How can I find out the DB permissions of the current user?
Hi Experts,
I need to make sure that who ever is attempting to execute my stored procedure has the following permissions:
sysadmin fixed server role or the db_owner fixed database role
What would the query for this look like?
Thanks!
I need to make sure that who ever is attempting to execute my stored procedure has the following permissions:
sysadmin fixed server role or the db_owner fixed database role
What would the query for this look like?
Thanks!
>>sysadmin fixed server role or the db_owner fixed database role<<
You do realize that using a sysadmin role (and even a db_owner database role) to execute a Stored Procedure is a very risky proposition, right?
You do realize that using a sysadmin role (and even a db_owner database role) to execute a Stored Procedure is a very risky proposition, right?
ASKER
Here it is:
IF ((IS_MEMBER ('db_owner') IS NULL OR IS_MEMBER ('db_owner') = 0)
AND (IS_MEMBER ('sysadmin') IS NULL OR IS_MEMBER ('sysadmin') = 0))
IF ((IS_MEMBER ('db_owner') IS NULL OR IS_MEMBER ('db_owner') = 0)
AND (IS_MEMBER ('sysadmin') IS NULL OR IS_MEMBER ('sysadmin') = 0))
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for axnst2's comment #a38836879
for the following reason:
Thanks anyway!
Accepted answer: 0 points for axnst2's comment #a38836879
for the following reason:
Thanks anyway!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
WOW, you're welcome!
I didn't expect any points since it was already closed, I just didn't want you to get odd errors with sysadmin's being denied access when they should have it :-) .
I didn't expect any points since it was already closed, I just didn't want you to get odd errors with sysadmin's being denied access when they should have it :-) .
http://stackoverflow.com/questions/7048839/sql-server-query-to-find-all-permissions-access-for-all-users-in-a-database