Results 1 to 6 of 6

Thread: Max Text Length

  1. #1
    Join Date
    Apr 2003
    Posts
    114

    Unanswered: Max Text Length

    What is the maximum text length that can be entered into a sql server field and what data type should be used for it?

    Thanks!

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Re: Max Text Length

    Originally posted by Bobba Buoy
    What is the maximum text length that can be entered into a sql server field ?
    2,147,483,647 bytes

    Originally posted by Bobba Buoy
    what data type should be used for it?
    Text
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Apr 2003
    Posts
    114
    Thanks. If you were to limit a text area in a web interface to a certain number of characters to ensure that the user would not exceed that limit, how many characters would you think would be safe?

  4. #4
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    That would depend on the application
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  5. #5
    Join Date
    Apr 2003
    Posts
    114
    I am confused. When I use a varchar datatype, the default field length in 255. When I set it to text, it is 16. Anything you can tell me about this would be much appreciated.

  6. #6
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Originally posted by Bobba Buoy
    I am confused. When I use a varchar datatype, the default field length in 255. When I set it to text, it is 16. Anything you can tell me about this would be much appreciated.
    From the Holy Book (Sql server books online)

    Unless the text in row option is specified, text, ntext, or image strings are large character or binary strings (up to 2 gigabytes) stored outside a data row. The data row contains only a 16-byte text pointer that points to the root node of a tree built of internal pointers that map the pages in which the string fragments are stored.

    Moreover varchar datatype can store upto 8000 bytes of data
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •