Forum Moderators: open

Message Too Old, No Replies

importing from msaccess

         

dukelips

5:21 am on Sep 27, 2009 (gmt 0)

10+ Year Member



i had imported a table from access to sql 2000. the field columns are tagged as nvarchar(255). Is it better to leave to the field as such or change the column type to ntext

rocknbil

4:44 pm on Sep 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The comparison of varchar/nvarchar versus text/ntext is pretty consistent across most databases. Varchar is a smaller data type than text, thus can mean a smaller database table size. Also text/ntext data is stored separately from the other data, and can decrease retrieval performance.

Varchar contains a maximum of 8000 characters, text 2^31 - 1 characters, so you should probably only use text/ntext if you need more than that. In your case, it's limiting it to 255, which is even smaller still.

Also you only need to use the nvarchar type if you need to store unicode data. One site describes it as such:

The char/varchar value uses only one byte to store one character, the nchar/nvarchar value uses two bytes to store one character, so the char/varchar columns use two times less space to store data in comparison with nchar/nvarchar columns.