varchar vs nvarchar

  • I have been upsizing some Access dbs to SQL server and notice that 'text' field data types end up as 'nvarchar'. And I think memo fields end up as 'ntext'

    I have always used 'varchar' out of habit when developing in SQL from scratch. I was under the impression that nvarchar and ntext and other data types beginning with 'n' were associated with unicode and required double the storage space.

    Is this correct?

    Is there a standard practice and preference amongst developers for nvarchar or varchar etc data types?

    Thanks in advance for your comments

    Mark

  • You are correct, the 'n' in nchar, nvarchar and ntext indicates that they are used for Unicode and means two bytes storage for every character. The standard practice is to use the datatype that is best suited to hold the data that will be stored in it. If you are only going to use English (for instance) then you should probably use varchar.

  • To add to Chris. I think this is just the default behaviour of the Access Upsizing wizard.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • And as long as there's no unicode characters, you can change the datatype without fear of losing data.

Viewing 4 posts - 1 through 3 (of 3 total)

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