Solved

nvarchar(max)

Posted on 2008-10-24
6
1,170 Views
Last Modified: 2012-05-05
i have a column that i changed to nvarchar(255) to nvarchar(max)

now when I update the data something small like '123'
I get error

no row was updated
the data in row 1 was not committed
Error source: .Net  SqlClient data Provider
Error Message: String or binary data would be truncated
The statement has been terminated

123--is only 3 characters.  I changed it to nvarchar(max), why am i getting this error?
0
Comment
Question by:yanci1179
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 8

Expert Comment

by:jorgesv13
ID: 22799898
Are you using a DataSet / Table Adapter for making the Insert?
Check the field definition of the Datatable in your table adapter.
It might have a low value for "Max Length"
0
 

Author Comment

by:yanci1179
ID: 22799917
i am doing an update on the database itself.  with an update statement and directly to the table
0
 

Author Comment

by:yanci1179
ID: 22800062
i did sp_help on the table and the length is -1 for the column that i changed to nvarchar(max)

I changed it to varchar(1000) and it shows the length correctly. I reverted back to nvarchar(max) and it shows - 1 again.
0
 

Accepted Solution

by:
yanci1179 earned 0 total points
ID: 22800236
okay i figured it out...... stupid actually.  the original table has a trigger on it and was updating the column of another table that was smaller.  once i made the other column nvarchar(max) it worked.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22804788
Great!  Now please close the question.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

739 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