Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    6

    Unanswered: VARCHAR vs NVARCHAR

    So I have an existing table that looks like:

    Code:
    ID          BIGINT
    VAL         VARCHAR(128)
    I am converting this table to something that will be multi language compliant. My question is, I know that NVARCHAR's take double the space of a VARCHAR. Do I actually need to double the length of the VAL field to store the same amount of data or does the DB handle that?

    Basically I want to store a 128 character NVARCHAR.. do I need to set my table up like this:

    Code:
    ID          BIGINT
    VAL         NVARCHAR(256)
    or

    Code:
    ID          BIGINT
    VAL         NVARCHAR(128)

  2. #2
    Join Date
    May 2006
    Posts
    6


    I think I posted this is the wrong forum

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    No. You do not need to double the length of the declaration. The value used in the declaration of nvarchar is the number of characters, not the number of bytes.

    Check Books Online and you will see that the maximum length for varchar is 8000, while the maximum length for nvarchar is only 4000.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •