varchar and nvarchar data types

  • Hi all

    I want to know the difference between varchar and nvarchar data types

    Thanks

  • The short answer is that the 'n' version supports 2 byte encoded unicode characters. Here is a short excerpt from SQL BOL.

    ---------

    Use of nchar, nvarchar, and ntext is the same as char, varchar, and text, respectively, except that:

    Unicode supports a wider range of characters.

    More space is needed to store Unicode characters.

    The maximum size of nchar and nvarchar columns is 4,000 characters, not 8,000 characters like char and varchar.

    Unicode constants are specified with a leading N: N'A Unicode string'.

    All Unicode data uses the same Unicode code page. Collations do not control the code page used for Unicode columns, only attributes such as comparison rules and case sensitivity.

    ---

    Dave

    Trainmark.com IT Training B2B Marketplace
    (Jobs for IT Instructors)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply