SQL Server Performance

Diffrence between text and ntext

Discussion in 'Getting Started' started by pinky, Jun 18, 2007.

  1. pinky New Member

    Hi all,
    What is the Diffrence between the text and ntext?

    Thanks & Regards,
  2. MohammedU New Member

    Unicode (ntext) has the capability to store characters from all languages, while text typically uses a local code page and can only use local characters.

    SQL Server uses 2 bytes per character for n-type text columns, while the not-n-type columns use 1 (at least for latin-based languages).


  3. satya Moderator

    quote:Using Unicode Data


    Each MicrosoftÂ® SQL Server#153; collation has a code page that defines what patterns of bits represent each character in char, varchar, and text values. Individual columns and character constants can be assigned a different code page. Client computers use the code page associated with the operating system locale to interpret character bit patterns. There are many different code pages. Some characters appear on some code pages, but not on others. Some characters are defined with one bit pattern on some code pages, and with a different bit pattern on other code pages. When you build international systems that must handle different languages, it becomes difficult to pick code pages for all the computers that meet the language requirements of multiple countries. It is also difficult to ensure that every computer performs the correct translations when interfacing with a system using a different code page.


    To addup Frank's post :
    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. Unicode supports a wider range of characters and more space is needed to store Unicode characters
    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
  4. FrankKalis Moderator

    Note, that if you are on SQL Server 2005 and do not intend to support SQL Server 2000 and below, that you should use (N)VARCHAR(MAX) instead of (N)TEXT. This data type is deprecated and will be removed in a future version.

    Frank Kalis
    Microsoft SQL Server MVP
    Contributing Editor, Writer & Forum Moderatorhttp://www.sql-server-performance.com
  5. pinky New Member

    Thank you very much.

Share This Page