Automate setting permissions to databases (SQL 2005)?



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: test just reinstalled my OS
    ... I never reformat a drive with valuable data on it, ... >> backup it's database file, reinstall it, and then add the database again. ... > LOL ...
    (comp.graphics.apps.lightwave)
  • Re: WSUS and WSS 3.0 broken
    ... I'd read the documentation first, and then if you don't find specific guidance, I would uninstall both, then reinstall companyweb, then reinstall WSUS. ... you might be able to get those database files back from shadow ...
    (microsoft.public.windows.server.sbs)
  • Re: WSUS and WSS 3.0 broken
    ... You might want to look at the WSUS release notes - I'm pretty sure ... Add/Remove, then reinstall? ... SBS monitoring & reporting now works as does WSS 2.0. ... you might be able to get those database files ...
    (microsoft.public.windows.server.sbs)
  • Re: Cant Install SP4 for SQL 2000 / Win2k3
    ... This explains why a reinstall did not fix the errors. ... ran 'sp_resetstatus msdb' from query analyzer, ... > The LSN %S_LSN passed to log scan in database '%.*ls' is invalid. ... > To resolve this problem, obtain the latest service pack for Microsoft SQL ...
    (microsoft.public.sqlserver.setup)
  • Re: Can not open and Error Message
    ... Allen Browne - Microsoft MVP. ... There is problem for ver 2002. ... I want to distribute my denomination chruch secretary database whose ... Do you think I need to uninstalled my ver 2002 and reinstall it again?. ...
    (microsoft.public.access.modulesdaovba)