Is there a way in sql server 2005 to query for enabled and disabled accounts? basically I wanted to see the current state of user accounts. I mean the accounts affected by command below. ALTER LOGIN someuser ENABLED|DISABLE
views:
17answers:
2
+1
A:
select * from sys.sql_logins
gives you the information you're after. Take a look @ the is_disabled
column.
Will A
2010-08-16 22:06:34
...edited to move from old-style to new-style catalog tables. `sys.server_principals` may be more appropriate if you want NT logins included as well.
Will A
2010-08-16 22:16:45
A:
You're "not supposed" to query the sys tables directly. sp_helpuser, sp_MShasdbaccess can be used as an alternative.
Conrad Frix
2010-08-16 22:17:25
Really? I thought that was what they were there for. Well, that, and supporting MSSQL in it's day-to-day running of course. :)
Will A
2010-08-16 22:29:44