t-sql large data size

  • In sql server 2012, I want to allow a user to enter data into large columns that are used for different types of comments.

    The largest varchar field that I am allowed to use is varchar(8000). I do not want to use varchar(max) since that will be deprecated at some point.

    The datatypes only need to be used for within the United States (English).

    Thus would you let me know what the largest field size is that I can use?

  • wendy elizabeth (7/14/2016)


    In sql server 2012, I want to allow a user to enter data into large columns that are used for different types of comments.

    The largest varchar field that I am allowed to use is varchar(8000). I do not want to use varchar(max) since that will be deprecated at some point.

    The datatypes only need to be used for within the United States (English).

    Thus would you let me know what the largest field size is that I can use?

    Can you point me to a reference which talks of varchar(max) being deprecated, please?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • wendy elizabeth (7/14/2016)


    In sql server 2012, I want to allow a user to enter data into large columns that are used for different types of comments.

    The largest varchar field that I am allowed to use is varchar(8000). I do not want to use varchar(max) since that will be deprecated at some point.

    The datatypes only need to be used for within the United States (English).

    Thus would you let me know what the largest field size is that I can use?

    Are you getting confused with text/ntext which are depreciated? varchar(max) and nvarchar(max) are the recommended replacements for these so no reason why they shouldn't be used.

  • I'm pretty sure you asked this question once already. Everyone suggested you use VARCHAR(MAX) but not TEXT, because TEXT is deprecated. Here's the documentation on VARCHAR. It stores up to 2gb of information. That should be enough for any comments field.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • @wendy,

    I'll recommend again that you get a copy of Books Online (BOL for short) and use it. It clearly stated under the TEXT datatype that it is what has been deprecated and not VARCHAR(MAX). Learn to use the "INDEX" feature. It will save you much heartache and wasted time.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply