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)
 Roles

Author  Topic 

honey_191
Starting Member

49 Posts

Posted - 2008-05-09 : 15:37:09
Hi,can anybody tell me the script for how to find out for a particular login n for a particular database ,what are the database roles they have??

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-09 : 15:49:03
So you think what I have given is a waste. Did you ever try that?
Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-09 : 15:57:44
No,I mean can i get every thing in one query?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-09 : 16:26:18
Without trying how can you say that's not a right one.

Did you try with sp_helplogins? you will get all databases and associated role they have .
Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-12 : 17:55:13
If i need to find out all the logins(suppose 700 logins) & all the databases,is there any script for this?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-12 : 18:22:01
honey_191, did you even try running sp_helplogins to see what it returns? How hard is it for you to test this?!

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-12 : 18:30:00
she thinks that doesn't work. She needs long-lengthy script.
Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-12 : 21:29:02
Sorry Tara & sodeep,I tried sp_helplogins.If i use this i can able to get one login info at a time.But what if i have some 500 logins in a server,Do i need to run for each & every login?Is there any other options?Sorry to bother u..
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-12 : 22:31:31
Just run sp_helplogins.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-12 : 22:40:13
quote:
Originally posted by honey_191

Sorry Tara & sodeep,I tried sp_helplogins.If i use this i can able to get one login info at a time.But what if i have some 500 logins in a server,Do i need to run for each & every login?Is there any other options?Sorry to bother u..



You don't run it for every login. It outputs everything that you want. You apparently haven't tried it yet.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-12 : 23:32:58
Yeh,I got it.Thanks for the help.
Go to Top of Page
   

- Advertisement -