Re: Generating code for Application Roles.
From: Mary Chipman (mchip@nomail.please)
Date: 03/26/03
- Next message: corrie: "re junk mail"
- Previous message: Expert: "Re: Getting Slammed by Virus"
- In reply to: Roger Gillim: "Generating code for Application Roles."
- Next in thread: Tom Williams: "Re: Generating code for Application Roles."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Mary Chipman <mchip@nomail.please> Date: Tue, 25 Mar 2003 18:50:23 -0500
You can get the syntax for creating the approle out of Books Online.
If you want to generate a script to assign permissions to all objects,
you can take advantage of the Query Analyzer. Set the output pane to
text (not grid) and execute the following statement (where Approlename
is the name of your approle):
SELECT 'GRANT ALL ON ' + RTrim(name) + ' TO AppRoleName ' +
CHAR(13) + CHAR(10) + 'GO' FROM sysobjects WHERE type = 'U'
This will generate output that you can then paste into another query
pane, edit, and execute. type=U is for user tables.
-- Mary
MCW Technologies
http://www.mcwtech.com
On 25 Mar 2003 10:16:49 -0800, rgillim@vdh.state.vt.us (Roger Gillim)
wrote:
>I have a database with Application Roles that give permissions to
>tables, views, and stored procedures.
>
>I have made the code to create a copy of the structure of the
>database, but with out application roles.
>
>Assume I execute that code. I now have a database with no application
>roles set.
>
>I would like to generate the code for the Application role such that,
>when the code is executed, the application role would be added:
>(sp_addapprole), and permissions (Grant) set for all of the objects in
>the database.
>
>Using an existing database, how do I generate the code that creates
>the application role in the database, and then sets the permissions
>for the objects?
>
>Thanks.
>Rog Gillim
>Vermont Dept of Health
>Burlington VT 05402
>
>rgillim@vdh.state.vt.us
- Next message: corrie: "re junk mail"
- Previous message: Expert: "Re: Getting Slammed by Virus"
- In reply to: Roger Gillim: "Generating code for Application Roles."
- Next in thread: Tom Williams: "Re: Generating code for Application Roles."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|