String or binary data would be truncated

Hi

I am running an INSERT form one tables into another. I am getting below error;

Msg 8152, Level 16, State 10, Line 10
String or binary data would be truncated.

As I have a whole bunch of columns how do I figure which column is involved in error?

Thanks

Regards

August 23rd, 2015 4:57pm

Take a look at this blog post

How to find what column caused the String or binary data would be truncated message 

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 5:04pm

Hi Yahya,

The length of the data in source table is biggest than destination table.

You can compare the columns by the CHARACTER_MAXIMUM_LENGTH in both tables (Source Column and Destination Column) by the following command:

SELECT COLUMN_NAME,* 
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YourTableName' AND TABLE_SCHEMA='YourSchemaName'

Best Regards

August 23rd, 2015 9:03pm

Your Destination column size is less lesser and Data insertion length is high .Increase column lengh in destinat
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 9:24pm

Simple matter,

Source table's column length is higher than destination .


August 24th, 2015 12:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics