Username and Password in SQL Server

User Names and passwords are saved in sys.syslogins table of Master DB but SQL Server doesn’t save passwords in plain or encrypted form for the obvious purpose of Security. When you query sys.syslogins table, it will return an un-readable string in password field. Passwords are saved in hashes and because they are one way hashes hence they can’t be reversed. We can use pwdcompare to compare password hashes and can identify a user but can never return a plain password string. This query might help.

SELECT * FROM sys.syslogins WHERE pwdcompare(‘somepassword’, password) = 1

About Sallah Ud Din Sarwar

I am a multi skilled Software Engineer with over 4 year’s industry experience in designing and developing Object oriented solutions in Multi layered & N-Tired. I have substantial success to my credit. I have consistently handled complex problems to the satisfaction of my clients by working in stressful situations. I enjoy learning and applying new technologies in a dynamic and forward thinking professional environment.

Check Also

Mastering object-oriented programming (OOP) Concepts: A Comprehensive Guide for C# Interviews

Enhance your C# interview preparation with this comprehensive guide on mastering object-oriented programming (OOP) concepts. Unlock essential OOP pillars, understand solid principles, and gain confidence for success.

Leave a Reply