Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8168755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:37:58+00:00 2026-06-06T20:37:58+00:00

I have a SQL row with type summary NVARCHAR(4000) NULL and before I add

  • 0

I have a SQL row with type

summary NVARCHAR(4000) NULL

and before I add any data to the table I check it in code and fix it if the user has entered a string that is too long for the database using this code

if (instanceToCrop.Description != null && instanceToCrop.Description.Length > 4000) instanceToCrop.Description = instanceToCrop.Description.Substring(0, 4000);

If I change my table thus

ALTER TABLE Timeline
ALTER COLUMN summary NVARCHAR(MAX)

what constant should I use in place of 4000 to keep the submitted string below the length that the SQL server would reject?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:38:00+00:00Added an answer on June 6, 2026 at 8:38 pm

    The max number of characters you can store in an NVARCHAR(MAX) is 1,073,741,823 or very close to that. If your users can enter that amount of text in your textbox, there’s probably something not optimal going on … are they pasting The Bible or the transcript for all of the Lord of the Rings movies?

    I think you can set a much more practical limit, but we can’t really tell you what that should be… 50,000 characters? 100,000 characters? Something less than 64KB for network / packet reasons? Don’t know, that seems to be a business decision, not a technical one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single row of data in a SQL Server table that I'm
I have a SQL table where in each row I store the country and
I have a microsoft sql 2005 db table where the entire row is not
Possible Duplicate: Concatenate row values T-SQL I have a table like this: ref_num name
I have a Sql Server 2005 table with following data: idHearing is the primary
In the program I have, I depend on the SQL Server TIMESTAMP data type
Hi I have sql code like that: SELECT vote_id, (SELECT type FROM vote_types WHERE
Suppose I have some data types defined in PL/SQL: TYPE foo_t IS RECORD (...);
I have SQL Query, I want to add insert blank row in result so
I have a column in SQL Server of smallint type. I read the row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.