April 3, 2011 at 9:18 am
hi to all,
where does the loginid and password are stored ?
how can i access them by writting code.?
April 3, 2011 at 10:37 am
They're in master.
You can get usernames from sys.server_principals, you can get the hashed passwords from sys.sql_logins (I think) but there's no way to get the plaintext passwords. SQL doesn't store the passwords as plaintext, only the hashed form.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 3, 2011 at 10:48 am
You can query sys.server_principals to get login related information.
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
April 3, 2011 at 1:19 pm
The following will get you login names, SIDs and hashed passwords
select name, sid, password_hash from sys.sql_logins
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
April 4, 2011 at 2:16 am
hi ,
some one asked me that window authentication user-id and password are stored in which db.
i replied to that person as there is no user-id and password for window authentication in sql server.
am i false or true.
only sql authentication user-id and password are there which is stored in master db.
am i false or true.
April 4, 2011 at 2:22 am
You are right Ivan. When using Windows Authentication, the login credentials are checked in the Active Directory. No information is saved locally in SQL Server.
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
April 4, 2011 at 2:29 am
Ivan Mohapatra (4/4/2011)
some one asked me that window authentication user-id and password are stored in which db.i replied to that person as there is no user-id and password for window authentication in sql server.
With windows authentication, the login name is stored in master (query sys.server_principals) along with the SID (security identifier), but the password is not. The only place that stores the password is Active Directory
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply