Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How to resolve "String or binary data would be truncated" error copying nvarchar(10) to char(10)?

Asked by Ben Phillips Apr 16, 2021 1.3K views 1 answer
Share

About this question

I am inserting values from one SQL table/column into another. The datatypes are different for these columns due to other reasons but I do not understand why nvarchar(10) source and char(10) destination results in an error sometimes in SQL Server 2014: String or binary data would be truncated. len(sourcecol) = 10 and data length(sourcecol) = 20. Could it be because of some invisible spaces/characters stored in the source column which is of type nvarchar? How solve the”String or binary data would be truncated" error?

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.