>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

nVaChar, varchar and nText

I've been asked what the differences are between nVaChar, varchar and nText. The answer is:

NVARCHAR uses 2-byte characters so only half the "max" data (4000 vs 8000) characters can be stored. If you must support UTF-8 character sets, NVARCHAR is the way to go. If not, stick with VARCHAR for single-character character sets.

TEXT is intended for data in excess of 8000 bytes, but it can't be indexed, so you'll have to design a lookup scheme other than searching for matches in the TEXT column.

Source: SQL Team.com


 
Comments
Will Wilson's Gravatar makes sense! Thanks
# Posted By Will Wilson | 01/11/07 10:57 | Report abusive comment
Russ michaels's Gravatar Lets expand that a bit.
The max data length for a row is 8000 chars (approx), so if you had a varchar column of 8000 then you would not be able to have any other columns. when the amount of data in a row exceeds 8000, it will get truncated.
this rule does not apply when usig TEXT data type as this is a BLOB, and in effect all that is stored in the row is a pointer to the BLOB.
When using TEXT fields, you will need to use FULL-TEXT catalogues for indexing, and the FULL-TEXT catalog commands, such as CONTAINS only work on TEXT fields.
# Posted By Russ michaels | 16/11/07 15:10 | Report abusive comment
Russ michaels's Gravatar Lets expand that a bit.
The max data length for a row is 8000 chars (approx), so if you had a varchar column of 8000 then you would not be able to have any other columns. when the amount of data in a row exceeds 8000, it will get truncated.
this rule does not apply when usig TEXT data type as this is a BLOB, and in effect all that is stored in the row is a pointer to the BLOB.
When using TEXT fields, you will need to use FULL-TEXT catalogues for indexing, and the FULL-TEXT catalog commands, such as CONTAINS only work on TEXT fields.
# Posted By Russ michaels | 16/11/07 15:11 | Report abusive comment
Nick Tong's Gravatar Thanks for the feedback Russ
# Posted By Nick Tong | 19/11/07 21:23 | Report abusive comment
Sohbet's Gravatar thank :D:D
# Posted By Sohbet | 29/08/08 02:01 | Report abusive comment
Sohbet's Gravatar thank :D:D
# Posted By Sohbet | 29/08/08 02:01 | Report abusive comment
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.