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 8320149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:33:32+00:00 2026-06-08T22:33:32+00:00

I am trying to solve a problem very similar to Convert from UniqueIdentifier to

  • 0

I am trying to solve a problem very similar to Convert from UniqueIdentifier to BigInt and Back? Unfortunately that example doesn’t show the whole process, it only shows converting a GUID back to BIGINT.

I’ll call this a hypothetical problem since I’ve already decided that storing integers as GUID’s isn’t very beneficial. However at this point, I simply want to know why the conversion process isn’t working.

Everything looks good until step 5….

SELECT  1 AS Step
        ,100966116980299

SELECT  2 AS Step
        ,CONVERT(VARBINARY(8), 100966116980299, 1)

SELECT  3 AS Step
        ,CONVERT(UNIQUEIDENTIFIER, 
            CONVERT(VARBINARY(8), 100966116980299, 1)
        )

SELECT  4 AS Step   
        ,CONVERT(VARBINARY(8), 
            CONVERT(UNIQUEIDENTIFIER, 
                CONVERT(VARBINARY(8), 100966116980299, 1)
            ), 1
        )

SELECT  5 AS Step   
        ,CONVERT(BIGINT, 
            CONVERT(VARBINARY(8), 
                CONVERT(UNIQUEIDENTIFIER, 
                    CONVERT(VARBINARY(8), 100966116980299, 1)
                ), 1
            )
        )

Results

Step    Value
1       100966116980299
2       0x0F0000014B768901
3       0100000F-764B-0189-0000-000000000000
4       0x0F0000014B768901
5       1080863916129945857
  • 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-06-08T22:33:35+00:00Added an answer on June 8, 2026 at 10:33 pm

    I think that the problem here is that the value 100966116980299 that you are using is not being interpreted as BIGINT in the first place. Take a look to what happens if you first do an explicit cast to BIGINT:

    SELECT  1 AS Step
            ,CAST(100966116980299 AS BIGINT)
    
    SELECT  2 AS Step
            ,CONVERT(VARBINARY(8), CAST(100966116980299 AS BIGINT), 1)
    
    SELECT  3 AS Step
            ,CONVERT(UNIQUEIDENTIFIER, 
                CONVERT(VARBINARY(8), CAST(100966116980299 AS BIGINT), 1)
            )
    
    SELECT  4 AS Step   
            ,CONVERT(VARBINARY(8), 
                CONVERT(UNIQUEIDENTIFIER, 
                    CONVERT(VARBINARY(8), CAST(100966116980299 AS BIGINT), 1)
                ), 1
            )
    
    SELECT  5 AS Step   
            ,CONVERT(BIGINT, 
                CONVERT(VARBINARY(8), 
                    CONVERT(UNIQUEIDENTIFIER, 
                        CONVERT(VARBINARY(8), CAST(100966116980299 AS BIGINT), 1)
                    ), 1
                )
            )
    

    Results

    Step    Value
    1       100966116980299
    2       0x00005BD40189764B
    3       D45B0000-8901-4B76-0000-000000000000
    4       0x00005BD40189764B
    5       100966116980299
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to solve this problem : http://uva.onlinejudge.org/external/7/732.html . For the given example, they
I have a similar technical problem I am trying to solve where I am
Trying to solve a very simple problem using mvvm-light, but after days of sifting
I'm trying to solve a two-dimensional random walk problem from the book, exploring python.
I have a very difficult problem I'm trying to solve: Let's say I have
I am very new to matlab and trying to solve portfolio optimization problem (minimizing
Trying to solve this problem: I have the following set of divs that when
I've got a problem that I'm trying to solve for hours, and I'd be
I am very interested in Haskell and currently trying to solve this problem. To
I am trying to solve a problem where i have a WCF system that

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.