Re: Security within a stored procedure
From: Mary Chipman (mchip_at_online.microsoft.com)
Date: 08/18/04
- Next message: D Dub: "Re: Does MSSQL service account rights"
- Previous message: Steve Thompson: "Re: What is the difference?"
- In reply to: Demian Valle: "Security within a stored procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 18 Aug 2004 10:47:58 -0400
Are you creating/dropping temp tables in tempdb or actual tables in
the database? Are you running dynamic SQL inside the sproc? In general
you only need to grant EXEC on stored procedures and can deny
permissions on base tables as long as the code in the stored procedure
follows the rules. See "Programming Stored Procedures" and "Using
Ownership Chains" in SQL BOL for more info. You can download the
latest version of BOL from
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp.
--Mary
On Tue, 17 Aug 2004 17:19:14 -0700, "Demian Valle"
<dvalle@nmccentral.com> wrote:
>I have a user with a database role of "denydatawriter" so
>that the user can run reports in Access but not change any
>data in the SQL Server database.
>
>However, there is a stored procedure that this user needs
>to execute and the stored procedure creates and drops
>several temporary tables. I have granted the user EXEC
>permission on the stored procedure but SQL still insists
>that the user does not have permission to create or drop
>tables.
>
>I have also tried to temporarily grant permission to
>create and drop tables within the body of the stored
>procedure but this returns errors stating that the user
>does not have the ability to grant permissions.
>
>Is there a quick way to give a user the ability to do
>anything within the confines of a stored procedure but
>still maintain read-only access for the rest of the
>database?
>
>Thanks.
- Next message: D Dub: "Re: Does MSSQL service account rights"
- Previous message: Steve Thompson: "Re: What is the difference?"
- In reply to: Demian Valle: "Security within a stored procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|