Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Scripting all the Users and Roles

Author  Topic 

swekik
Posting Yak Master

126 Posts

Posted - 2009-02-16 : 14:52:58
Hi,

Is there any script to script out all the users and the roles associated to the users in a database ?I tried finding out the script ,didn't succeed .

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-16 : 15:03:58
sp_helplogins
Go to Top of Page

swekik
Posting Yak Master

126 Posts

Posted - 2009-02-16 : 16:10:00
Thanks for the response Sodeep ,It will list out all the permissions but it didn't give the create script .
Go to Top of Page

revdnrdy
Posting Yak Master

220 Posts

Posted - 2009-02-16 : 16:52:21
Would sp this help you out?

sp_helprotect

r&r
Go to Top of Page

swekik
Posting Yak Master

126 Posts

Posted - 2009-02-16 : 17:32:04
It will also list out all the permissions but didnot generate any create script .
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-16 : 18:54:03
quote:
Originally posted by swekik

It will also list out all the permissions but didnot generate any create script .



What is that? Please elaborate.
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-02-24 : 04:52:06
quote:
Originally posted by swekik

Hi,

Is there any script to script out all the users and the roles associated to the users in a database ?I tried finding out the script ,didn't succeed .



you can use sqldmo to script database objects....there are lot script available ...

Regards,
Ahmad Osama
Go to Top of Page

saurabhsrivastava
Posting Yak Master

216 Posts

Posted - 2009-02-24 : 12:57:43
Go to Script section of SQLTEAM.com and check out my script
"Transfer logins SQL2005 to SQL Server 2008"
It captures users and roles each user is assigned. If you are running SQL 2005. ALso, you can filter at database level or user level.

Go to Top of Page
   

- Advertisement -