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

  • Home
  • SEARCH
  • 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 4617606
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:08:52+00:00 2026-05-22T02:08:52+00:00

A while ago I asked a question about hierarchy/version number sorting in SQL Server.

  • 0

A while ago I asked a question about hierarchy/version number sorting in SQL Server.
(
How Can I Sort A 'Version Number' Column Generically Using a SQL Server Query).

Among the answers that were submitted was this link to a TSQL Coding challenge with much the same puzzle.

In the SQL2000 solution the author demonstrated a two variations, one using and returning a varchar and the other varbinary. The author explains THAT he is doing this without explaining WHY.

So, my question is really, what main differences/advantages (if any) of the difference in approach? I.e. why use a varbinary instead of a varchar?

I’ve omitted posting the code, as its most elegantly summed up in the above article.

  • 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-22T02:08:53+00:00Added an answer on May 22, 2026 at 2:08 am

    I believe the expectation is that the varbinary data will generally consume fewer bytes (5), than the varchar one (10 or 11, I think) per portion of the original string, and so, for very large numbers of components, or comparisons to occur, it should be more efficient.

    But I’d recommend that if you were looking to use either solution, that you implement both (they’re quite short), and try some profiling against your real data (and query patterns), to see if there are practical differences (I wouldn’t expect so).

    (Crafty Steal): And as Martin points out, the binary comparisons will be more efficient, since it won’t involve all of the code that’s there to deal with collations. 🙂

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

Sidebar

Related Questions

A while ago, I asked a question about $ , and got useful answers
I asked a question while ago about accessing the underlying container of STL adapters
I asked a question a while ago about which local DB was right for
Update I asked this question quite a while ago now, and I was curious
This question was asked quite some time ago, and while it covers possible solutions
Some time ago I asked a question about nested loops on SO and as
I've asked one question about this a month ago, it's here: "post" method to
I asked this question a while ago. I now know it is a Bad
I'm just rephrasing the question I asked a little while ago. I have a
I raised a question about this a while ago but I'm still having an

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.