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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:34:21+00:00 2026-05-30T18:34:21+00:00

How do you decided whether to use nvarchar or nchar ? For instance I

  • 0

How do you decided whether to use nvarchar or nchar ?

For instance I have noticed that the default membership database created by sqlmembership provider declares the Email column to be type nvarchar(256)

To me that seems like an unnecessarily large maximum value for an email column. I would suspect in normal circumstances emails longer than 40 or 50 characters would be pretty rare.

But as data such as email addresses vary in length should they always be stored as a nvarchar so as to eliminate redundant space?

If using nvarchar for an email column. In the event of an email address being changed, if the new email is longer than the previous email will this cause many page splits and therefor much of a performance cost?

Would you ever consider using nchar(40) for an email address and compromising loss of storage space in return for no page split performance costs?

Or would using nchar(40) significantly increase database size thereby cause other performance hits on query speed?

Would ‘only use nchar when you know the size of data to fill the column’ be a reasonable rule to follow?

  • 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-30T18:34:22+00:00Added an answer on May 30, 2026 at 6:34 pm

    emails longer than 40 or 50 characters would be pretty rare

    It only takes one to ruin your model…

    if the new email is longer than the previous email will this cause many page splits

    No. But even if it did, that’s not how you design you data model. Lets say, for the sake of argument, that every time an email is update it would cause a page split. Would you optimize for that? No, because pre-allocating a large fixed size (ie. using a NCHAR(256)) is far worse, it does indeed eliminate the potential page split on update (again, if such a page split would occur) but at the far worse cost of increasing the table size, which translates to IO bandwith and memoy consumption, see Disk space is cheap…THAT’S NOT THE POINT!!!.

    Why do I say that variable length updates do no cause page splits? Because page splits are forced when the row image no longer fits in the page. An update to a variable length column will likely cause row-overflow and leave the row at the same size as before, or even smaller. There are cases when the row will increase in size after the overflow, but there several condition for this to actually trigger a page split:

    • the value update has to trigger a row size increase, this can only happen when updating from a value of fewer than the 24-byte pointer described in Table and Index Organization to a value larger than this pointer size.
    • the increase in row size (which by definition is at most 24 bytes increase for each variable column being updated, including updates from NULL to non-NULL) have to result in a row that does not fit in the page.
    • there should be no possible space reclaim in row from pushing other fields off-row (ie. all variable length fields are already pushed off-row)

    I really don’t buy that you have such a strange and esoteric workload as the conditions above to be the major factor in driving your design. Use a NVARCHAR of convenient length to accommodate for any value you’ll encounter.

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

Sidebar

Related Questions

In my search I found mostly arguments for whether to use plurality in database
I have decided (whether bravely or foolishly remains to be seen) decided to increase
I have decided to use IoC principles on a bigger project. However, i would
After several failed attempts using ExtJS I have now decided to use javascript.The requirement
How to decide whether to use threads or create separate process altogether in your
I'm trying to decide whether to use a Rails or a Django guru to
I am crafting an application and cannot decide whether to use the terms Login/out
What criteria should I use to decide whether I write VBA code like this:
I'm trying to decide whether it is better to use static methods for loading/saving
I'm wondering what decides whether you're allowed to use <Header.h> or Header.h when you're

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.