Link to home
Start Free TrialLog in
Avatar of VivekrkKhare
VivekrkKhare

asked on

String or binary data would be truncated.

String or binary data would be truncated.
                  The statement has been terminated.

Is there an easy way to know for which column the problem is coming,in case of insert, and for which row value (or string)"

I have 181 Columns having varchar type with more then 18000 Rows..

Now I added 50 more columns to this table and create a new table
I am running query
insert into table2( < 181 column names> )
select <181 Column Names > from Table1

I am getting this error How can I get the Specific Column Name for which column the problem is coming
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

You can check whether some column data types are changed by looking the DDL's of both the tables and identifying it or from the Information Schemas.

SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = ''
AND TABLE_NAME = ''

Other than that there are no other easy ways I guess.
>>I am getting this error How can I get the Specific Column Name for which column the problem is coming<<
If this is occurring in DTS you can check the box "Turn on just-in-time debugging" to stop at the exact error.  Alternatively, you can tempoararly add a file name to the Exception file so that it can report any errors and you can inspect the file.
Avatar of VivekrkKhare
VivekrkKhare

ASKER

I check it with Turn on just-in-time debugging but not get success, please let e know how to add Exception file while ruan a query?
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial