I searched for an answer in the last 30 minutes on Google, but could not find a satisfactory answer.
I can get a list of db logins from the syslogins table, but it does not contain a field indicating whether the input is disabled. I need to use this in the selected query. Can anyone enlighten me?
Note that this applies to SQL Server 2000.
select name, hasaccess from sys.syslogins
I believe the hasaccess field is what you are looking for. According to MSDN , hasaccess is 1 if the login has access to the instance, and 0 if not.
hasaccess
1
0
Connection Reduction:
select the name, is_disabled from sys.sql_logins where is_disabled = 1 order for 1
use sys.sql_logins to check on / off login status. Example
select * from syslogins sl join sys.sql_logins sql on sl.sid=sql.sid where is_disabled=1
SELECT is_disabled,* FROM sys.sql_logins
The accepted answer is incorrect because it does not provide useful information. If the account is disabled, the hasaccess column can still be 1 .
Closest correct:
select name,is_disabled,* from sys.sql_logins where name = '' , if its an SQL account.
Source: https://habr.com/ru/post/1381040/More articles:Best internationalization practices using PyQt4 - python-3.xURI resolution from different sources on Android when opening an image - androidplayn-showcase-html is not a GWT project - eclipsejQuery.replaceWith does not accept