0

I use this query to create server login. I want to pass password like hash:

PASSWORD = hashed_password HASHED

How can I get the hash?

I use freetds to connect to server.

kaa
  • 1,265
  • 5
  • 22
  • 39

1 Answers1

1

If you are speaking about existing logins, you can use the Microsoft's sp SP_HELP_REVLOGIN. Here you can find the script to create this sp: http://support.microsoft.com/kb/918992

Giova
  • 1,137
  • 1
  • 9
  • 17
  • This is not exactly what I need. I want to create a new login by query. – kaa Jan 16 '15 at 08:08
  • @kaa: you need to know in advance the hash that the hashing algorithm will assign to your clear password? – Giova Jan 16 '15 at 09:10
  • But, you know, your suggestion is a part of the right answer. Here is a tutorial how to solve such problem: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f15a1ee1-e1df-4b51-987d-c1b094f2e71e/request-actual-example-of-create-login-with-password-hashed?forum=sqlsecurity – kaa Jan 16 '15 at 10:43