Home > Archive > Microsoft SQL Server forum > October 2005 > Stored Procs and db_owner









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Stored Procs and db_owner
db55

2005-10-31, 8:24 pm

I have some users that I need to run stored procedures, but they can't
seem to run them unless they are in the db_owner role of the database.

How do I give them access to run the stored procs without giving them
the complete rights of the db_owner role?

Thanks in advance.

Erland Sommarskog

2005-10-31, 8:24 pm

db55 (chfran@gmail.com) writes:
> I have some users that I need to run stored procedures, but they can't
> seem to run them unless they are in the db_owner role of the database.
>
> How do I give them access to run the stored procs without giving them
> the complete rights of the db_owner role?


GRANT EXECUTE ON proc TO user

Or rather than granting permissions directly to users, it's probably
better than adding them roles, and then grant access to the role instead.

But note that just because you grant them access to run the procedures,
that does not mean that they can run the procedures successfully. They
will get SELECT, INSERT, DELETE and UPDATE permissions to tables referenced
by the stored procedures, if the tables and procedures have the same
owner. However, this so-called ownership chaining does not apply to
other statements such as CREATE/DROP TABLE (temp tables are OK) or
TRUNCATE TABLE.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com