Results 1 to 3 of 3

Thread: VARCHAR to NVARCHAR

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    64

    VARCHAR to 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
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: VARCHAR to NVARCHAR

    For string datatypes the length is the number of characters that the field can contain - not the number of bytes required to store/use the data.

    use NVARCHAR(128)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    64

    Re: VARCHAR to NVARCHAR

    thank you

Posting Permissions

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



Click Here to Expand Forum to Full Width