Search code examples
sql-serversql-server-2005t-sqlsql-server-2000

TSQL to find if logins have password same as loginname?


I want to check if SQL logins have passwords same as thier login name. E.g. login name 'abc123' has password= 'abc123'. I need to do this for a security audit across many 2000 and 2005 servers.

Is it possible to check using TSQL?

Thanks in advance


Solution

  • select * from syslogins where pwdcompare (name,password)=1
    

    BOL: pwdcompare