Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell whether a database login is disabled without using the GUI in a select query

I have been searching for an answer for the last 30 minutes on google, but haven't been able to find a satisfactory answer.

I am able to retrieve a list of db logins from the syslogins table, but it doesn't contain a field to indicate whether the login is disabled. I need to use this in a select query. Can anyone enlighten me?

Note that this applies to sql server 2000.

like image 572
deutschZuid Avatar asked Nov 13 '11 22:11

deutschZuid


2 Answers

Reducing the join:

select name, is_disabled from sys.sql_logins where is_disabled=1 order by 1

like image 145
user2980533 Avatar answered Sep 29 '22 21:09

user2980533


SELECT is_disabled,*
    FROM sys.sql_logins
like image 40
Gopakumar N.Kurup Avatar answered Sep 29 '22 20:09

Gopakumar N.Kurup