0

I need to get hashed passwords of users in Azure SQL DB (Single Database - Managed Instance). Users exist only on DB and not on server. Users were created with:

Create user xyz with password = 'abc'

I have tried LoginProperty function but it does not work in Azure SQL DB.

2
  • Hi, If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you Commented Oct 16, 2019 at 1:04
  • Leon Yue, Your answer does not solve the problem. Kindly take a look at my comment on your anser. Commented Feb 4, 2020 at 10:21

2 Answers 2

1

this option does not help with Azure SQL Database(PAAS) as i recieved the error: Keyword or statement option 'hashed' is not supported in this version of SQL Server.

Azure SQL does not have this option, it is deprecated. Not sure how a migration will be performed if password is not known of the account.

Sign up to request clarification or add additional context in comments.

Comments

0

Please see this document: sys.sql_logins (Transact-SQL), it supports Azure SQL database and returns one row for every SQL Server authentication login.

enter image description here

Run this query in your master DB, you can see the user password_hash.

For example, I created a login sagarreadonly' in master db, then created the user 'sagarreadonly' in my SQL database.

I can get the user's hashed password. Here is code:

use master
select name, password_hash from sys.sql_logins where name='sagarreadonly'

Screenshots:

enter image description here

Hope this helps.

1 Comment

Leon Yue, your answer is not what I required. I specifically mentioned that user is database level user and not present at server level. Your solution works only for server level user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.