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 6015917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:54:25+00:00 2026-05-23T02:54:25+00:00

While using sql 2005, it appears I am unable to insert more than 8000

  • 0

While using sql 2005, it appears I am unable to insert more than 8000 characters in a nvarchar(max) field.

This is really puzzling. I have tried insert, update and update .write with no luck. I can’t insert it completely in the console and in .net the error I consistently get is

The data types text and varchar are incompatible in the add operator.

The insert statement is

insert into tablename (columnname) values (' long text'); 

Update:

update tablename set columnname='long text' 

Everything is always truncated at 8000 characters (the text is 11,000 characters). Running a few tests, I see that

select @@textsize

gives 2147483647

Any ideas what I might be doing wrong here?

  • 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-05-23T02:54:26+00:00Added an answer on May 23, 2026 at 2:54 am

    Your code truncates the value somewhere. You did not include the entire code, so we cannot guess where it truncates. The usual place is parameter declarations. The correct code should be like this:

    SqlCommand cmd = new SqlCommand(
         @"insert into table (column) values (@param)", conn, trn);
    cmd.Paramaters.Add("@param", SqlDbType.NVarChar, -1);
    cmd.Parameters["@param"].Value = myLongVariable;
    cmd.ExecuteNonQuery();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Error while connecting to external SQL Server IP using SQL Management Studio 2005 address
I have been using LINQ to SQL for a while, and there is one
I've seen this quite a few times while using Office Interop classes this.CustomXMLParts.Add(MyResources.Data, new
I want to know what are pros and cons while using varchar(500) vs varchar(max)
I'm using sql-server 2005 Hi, i have Users table with userID and registrationDate. I
I'm using SQL Server 2005 and am logged in as sa . I would
I am using MS SQL Server 2005 as DBMS for my WinForms App. Data
When using the SQL Server (2005, 2008) Save Results As... option, I do get
I am developing one web application using asp.net 2005 and Microsoft SQL Server 2008
Currently I am using MS Sql2000, though we are discussing upgrading this to 2005

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.