Unix Technical Forum

SQL Logins

This is a discussion on SQL Logins within the SQL Server forums, part of the Microsoft SQL Server category; --> How can I get a list of all SQL server logins that are on a given sql server? What ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:11 PM
Len Svitenko
 
Posts: n/a
Default SQL Logins

How can I get a list of all SQL server logins that are on a given sql
server? What sql query would get me that? Or is there an sp that
gives me that. Also, if it could list what db they have rights to
that would be great also.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:11 PM
Raghuraman
 
Posts: n/a
Default Re: SQL Logins

Hi, Jpmc

As far the enterprise manager is concerned , it is almost a open book.
Any db cann be backed up & restored and the E.MANAGER might be
designed to view all the databases by any body. so only the log ins
are invisible when u restore the db.

but the db is in active when u try to open a db thru query analyser in
diff login which does not have the right to access the db.

The thing is u can work with any databases in E. manager .

i think u would be cleared .


With THANKS RAGHU
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:11 PM
Shervin
 
Posts: n/a
Default Re: SQL Logins

Len,

For a list of logins and their server roles check master..syslogins table.
To see if a login has access to a DB check DB..sysusers. syslogins table
gives you SID of each login, if this SID appears on a sysusers table in a DB
it means that user has access to this database.
To check user roles use sp_helprole and sp_helprolemember procedures.

In general, if you are looking for some kind of information that Enterprise
Manager can provide, simply run Profiler and go get the information using
EM, then check Profiler's log to get an idea how to do the same in your
program. This at least gives you some SP names to look up in Books Online.

Good luck,
Shervin



"Len Svitenko" <its_goodtobethe_king@yahoo.com> wrote in message
news:6092a26a.0310031640.19a46f03@posting.google.c om...
> How can I get a list of all SQL server logins that are on a given sql
> server? What sql query would get me that? Or is there an sp that
> gives me that. Also, if it could list what db they have rights to
> that would be great also.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:04 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com