Re: Automate setting permissions to databases (SQL 2005)?



Here is a bunch of links for issues in that area:

http://www.sqlservercentral.com/scripts/contributions/1598.asp Script
Roles and Permissions

http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://msdn2.microsoft.com/en-us/library/ms345408(en-US,SQL.90).aspx Moving
system dbs 2005
http://www.databasejournal.com/features/mssql/article.php/3379901 Moving
system DB's 2000
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://www.support.microsoft.com/?id=221465 Using WITH MOVE in a Restore
http://www.sqlservercentral.com/columnists/cBunch/movingyouruserswiththeirdatabases.asp
Moving Users
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
a Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=320125 Moving a Diagram
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues 2000



--
Andrew J. Kelly SQL MVP

"AdamM" <adam@xxxxxxxxxx> wrote in message
news:un9nntilGHA.1272@xxxxxxxxxxxxxxxxxxxxxxx
I set a long list of granular user database permissions with every
reinstall of my development database and I would like to automate this work
with a script instead of doing this manually in SQL Server Management
Studio.

Is there a security settings export to file option? Or maybe some script
samples that show how to set user permissions?

I saw this example, but it requires both old and new databases to be
running at once. I reinstall the same PC repeatedly so this doesn't work
for me:
http://www.sql-server-performance.com/bm_object_permission_scripts.asp

Thanks!
Adam





.



Relevant Pages

  • Re: Cant read from database ??
    ... You also may need to worry about some permissions. ... http://msdn2.microsoft.com/en-us/library/ms345408.aspx Moving ... Issues When a Database Is Moved Between SQL Servers ... for SQL Server ...
    (microsoft.public.sqlserver.connect)
  • Re: SQL Object Transfer Task
    ... script and a CREATE script. ... the data and then reapply after moving the data. ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... Constant property can be used to make this happen. ...
    (microsoft.public.sqlserver.dts)
  • Re: object level permissions being lost when migrating
    ... While I understand that the permissions are at the ... Database level, that is why I am not understanding why I have an issue. ... Moving Users ... Errors After Restoring Dump ...
    (microsoft.public.sqlserver.security)
  • Re: Moving files in C++ using Windows SDK
    ... > computer that the code that's doing the moving is running. ... > LPVOID lpMsgBuf; ... > I get an error message usually saying access denied. ... Permissions are all set full for everyone, ...
    (microsoft.public.vc.language)
  • Re: object level permissions being lost when migrating
    ... Object permissions are at the db user level not the Login and are always carried over with the db. ... http://www.sqlservercentral.com/columnists/cBunch/movingyouruserswiththeirdatabases.asp Moving Users ... http://www.support.microsoft.com/?id=246133 How To Transfer Logins and Passwords Between SQL Servers ... http://www.support.microsoft.com/?id=168001 User Logon and/or Permission Errors After Restoring Dump ...
    (microsoft.public.sqlserver.security)