December 14, 2011 at 7:27 am
Hi,
I need a script that copy users, mapping between users and logins, user permissions from one db to another. The source database will be on the same server as target database.
The script will be run on many servers. Each server can have differrent loggins and source database can have different users, user permissions etc.
Thanks
December 14, 2011 at 7:35 am
well, searching the scripts and articles section here on SSC will get you lots and lots of examples for scripting out users and roles, and object permissions too;
permissions on the objects is certainly possible, so you plan on deploying the script agaisnt a standardized database schema, so all the expected objects exist?
what would happen if you generate a script for, say SELECT permissions on a specific view, but the view doesn't exist int he database?
Lowell
December 14, 2011 at 7:43 am
In fact, I only need to script out the users, database roles and the mapping between users and logins.
December 16, 2011 at 3:09 pm
In that case sys.database_principals and sys.database_role_members has all the metadata you need to build the commands that can add the Database Roles and Database Users to another database.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
December 16, 2011 at 4:16 pm
You can take the bits that you need out of here
http://www.sqlservercentral.com/scripts/Permissions/76450/
---------------------------------------------------------------------
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply