SQL Server Performance

Text Data Type

Discussion in 'T-SQL Performance Tuning for Developers' started by Brignola, Mar 11, 2003.

  1. Brignola New Member

    I'm trying to set up a local intranet, where people can send in news-items. I'm trying to set it up in a SQL-Server environment, but I'm having problems with the length of the fields.

    In Access, I used a Memo-field for the message itself, so I wanted to use a Text data type in SQL-Server. But I can only put in the same amount of characters as in a varchar(8000) field. Same thing with the nText field. I can only type about 1000 characters, wich is way too little for the message.

    Is there some parameter or something I have to set?

    If anyone knows, please respond, because I really want to get rid of the Access-database.

    Thx,
    Michael
  2. satya Moderator

    You can use nText or Text data type for those type of columns.
    As per BOL :ntext

    Variable-length Unicode data with a maximum length of 230 - 1 (1,073,741,823) characters. Storage size, in bytes, is two times the number of characters entered. The SQL-92 synonym for ntext is national text.

    text

    Variable-length non-Unicode data in the code page of the server and with a maximum length of 231-1 (2,147,483,647) characters. When the server code page uses double-byte characters, the storage is still 2,147,483,647 bytes. Depending on the character string, the storage size may be less than 2,147,483,647 bytes.



    To deal with text data types you have to use READTEXT/WRITETEXT/UPDATETEXT, for more information refer to books online.
    HTH

    Satya SKJ
  3. Brignola New Member

    Thx Mate

    Mike

Share This Page