varbinary to varchar conversion

  • Hi there

    I am wanting to pull out the password_hash from sys.sql_logins such that I can use it to re-create a login. Can anyone tell me why the following does not work, I have been trying to follow BoL on the style

    select convert(varchar(256), password_hash, 1) from sys.sql_logins

    Thanks

  • The hash is a true binary value, you'll have to convert it into hex or base64 encoded characters if you want to print it.

    I typically use sys.fn_varbintohexsubstring() but you can roll your own with CLR if you want.

    The probability of survival is inversely proportional to the angle of arrival.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply