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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:56:37+00:00 2026-05-16T20:56:37+00:00

The title really says it all, a bit more info though for those who

  • 0

The title really says it all, a bit more info though for those who bothered to click.

  • Strings will be of variable length typically between 2-5 characters in length, could occasionalyl exceed 5 characters and be upwards of 10. Never more than 10.
  • Will be queried on like such:
    • SELECT ... WHERE ... = 'abcd';
    • SELECT ... WHERE ... LIKE 'ab%';
  • Will be used in table JOINS.

I’m wondering if I should use nvarchar(10) or char(10) or varchar(10)? I don’t really know what the advantages or disadvantages of the above are for a case like mine. I appreciate any input you may have.

  • 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-16T20:56:37+00:00Added an answer on May 16, 2026 at 8:56 pm

    CHAR(10) will be padded to the defined length with spaces, e.g. if you have CHAR(10) and store “Stack” in it, the contents will really be “Stack…..”. Works great for things like state abbreviation (always 2 chars). But the padding does make the querying a bit more cumbersome at time.

    VARCHAR(10) will store as many chars as needed – more efficient, but more so for larger strings.

    NVARCHAR(10) will be the same – variable length – but with 2 bytes for each character (and NCHAR(10) is the same as CHAR(10) – only 2 bytes per character). Great for when you need to regularly support e.g. Asian, Cyrillic, or Arabic characters or other “non-Latin” alphabets. If you have Western European languages only (English, French, German, Spanish etc.), it’s a waste of space.

    My gut feeling tells me that CHAR/NCHAR might be a tad quicker when joining, but I don’t think it’ll really be a significant difference. Otherwise, if you have to reserve 10 characters for each entry, and most of them are only 2 to 5 chars, you are wasting some space, so that’s a downside for the CHAR/NCHAR types.

    So if I had to decide, I’d probably use VARCHAR(10) (without knowing all your detailed requirements, that is).

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

Sidebar

Related Questions

Question title says it all really - a lot slower than VS2005, with a
As the title says really. Does the virtual keyword cause a performance hit?
Pretty much what the title says really. We have some code that is .NET
As the title really, I'm in one part of my code and I would
The title may not really explain what I'm really trying to get at, couldn't
I'm not really sure how to title this question but basically I have an
OK, so I couldn't really think of an apropos title that summarizes this. The
Title says what i'm trying to do. I can successfully generate an assembly if
Title says it mostly. I want to add a simple extension method to the
Title is the entire question. Can someone give me a reason why this happens?

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.