Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6972689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:00:10+00:00 2026-05-27T17:00:10+00:00

Basically I am trying to give a user a certain password so I can

  • 0

Basically I am trying to give a user a certain password so I can test some functionality on a system, as I only have our admin account and I can’t play with that I am just picking a random account so I can do my testing. So here is my attempt at an update:

UPDATE dbo.Login
SET
  Salt=CAST('bPftidzyAQik' AS VARBINARY),
  Password=CAST('0x2B89C2954E18E15759545A421D243E251784FA009E46F7A163926247FDB945F85F095DBB1FFF5B2B43A6ADAE27B8C46E176902412C4F8943E39528FF94E0DD5B' AS VARBINARY)
WHERE LoginID=10947

It runs fine however the code in the database looks japanese for one and the syntax for the other looks fine but its not the value i’m putting in, I want it to use the exact value I put in so I can sign in. How do I do this? I’ve tried several different cast and convert solutions with no luck.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:00:11+00:00Added an answer on May 27, 2026 at 5:00 pm

    Try this:

    UPDATE dbo.Login
    SET
      Salt=CAST('bPftidzyAQik' AS VARBINARY),
      Password=0x2B89C2954E18E15759545A421D243E251784FA009E46F7A163926247FDB945F85F095DBB1FFF5B2B43A6ADAE27B8C46E176902412C4F8943E39528FF94E0DD5B
    WHERE LoginID=10947
    

    (you don’t need to cast a string storing a hex value into varbinary – that’s just what it is by default, without the quotes)

    The question is, how are you generating that password hex value, and are you using the same encoding to generate it as you are to read it? If you are planning on converting that data back into a string, you’ll need some code to do so. Here’s a function I wrote that does this:

    CREATE FUNCTION ConvertBinary
    (  
        @value AS varbinary(max)
    ) RETURNS VARCHAR(MAX) AS BEGIN  
    
        DECLARE @result AS varbinary(max),
                @result2 AS varchar(max),
                @idx AS bigint;
    
        IF @value IS null
            return null;
    
        SELECT @result = @value;  
        SELECT @result2 = '';
        SELECT @idx = 1;
    
        WHILE substring(@result, @idx, 1) != 0 AND @idx < len(@result)
            BEGIN
                SET @result2 = @result2 + cast(substring(@result,@idx,1) as char(1));  
                SET @idx = @idx + 1;
            END
    
        RETURN @result2;  
    
    END 
    

    I don’t know how helpful this will be for you, though, since it’s very possible that whatever app is using these fields is handling the values differently than this function expects. For the record, this function takes a varbinary value which was originally utf-8 string, and returns the varchar value of that string. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can some give me a good resource for the iphone filesystem? Basically I want
I recently came across this in some code - basically someone trying to create
I am basically trying to return from a method which reads user input from
I am trying to develop my login script to give feedback to the user
Basically what I'm trying to do is, I have an ASP.Net web application that's
I'm basically trying to give rubberbanding effect to my drawing, I'm using the setCompositionMode
I'm trying to build an authentication system in my application, but I'm having some
I'm trying to give OrientDB a go on Windows, but I can't even seem
Basically I have been trying to forge an understanding of matrix maths over the
I'm trying to have more control on the number we have next to our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.