Data Type Char. Limitations????

Posted on 2005-05-03
Last Modified: 2010-03-19
As far as I "know" an nvarchar is the MAX character holder in SQL.  Am I correct?  With a max lengh of 4000 char.  I have a project going on, where a majority of the time, the values will not exceed 4000, however, in beta testing for over 2 weeks with the end users, I finally had a dump into SQL exceeding 4000.  Is there any other Data Type that will allow SQL to exceed 4000 char, so I don't run into this down the road?
Question by:chrisryhal
    LVL 34

    Accepted Solution


    Do you actually need an nvarchar?

    You can also use a text datatype, but performing updates can get a little complex later.
    LVL 75

    Assisted Solution

    by:Anthony Perkins
    varchar (or char) have a maximum of 8000 characters.  You only need nvarchar (or nchar) if youa re using unicode (double-byte) characters.

    text data types have a maximum of 2GB, but have limitations as to the functions and SQL clauses you can use.
    LVL 2

    Author Comment

    As per your postings, you both posted within (1) min of one another, so I will split the points.  I was unaware that those other datatypes offered a longer character limit.  8000 would definitly be enough.

    Thanks for the advice.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now