binary or string data would be truncated => error message enhancments
if you have that error (in production), it's not obvious to see which column or row this error comes from, and how to locate it exactly.
it's even more complicated if it's coming from a trigger, for example, and not the original insert/update.
I have seen that oracle meanwhile gives clear information which column the error is raising, which actual data length was passed, and the column's max size.
This feature is shipped in SQL Server 2017 CU12, SQL Server 2019 CTP and upcoming SQL Server 2016 CP2 CU. Read more at https://blogs.msdn.microsoft.com/sql_server_team/string-or-binary-data-would-be-truncated-replacing-the-infamous-error-8152/
Kirk Riz commented
Yes please. It would eliminate having to write C# script in SSIS to get the information
Robin Wilson commented
This would be so helpful and save so much time. Obviously SQL Server knows which column hit the error but the details of the caught error are not passed back to the user leading you to have to keep removing columns until you figure it out.
Amen! Much better ways to spend our time than chasing this when it happens.
yes please replace it with some useful message
[Deleted User] commented
Hard to believe this is STILL an issue. It has been irritating sql developers forever and it is clearly obvious that the engine can tell which column(s) are causing the issue. Such a useless generic error message that could be turned into such a helpful thing so easily.
a more "Oracle Like" error message would be greatly appreciated. I just spent 1/2 day tracking one of these down. What a pain.
This issue has plagued me since my introduction to SQL Server some 20 years ago (SQL Server 6.5). An enhancement is loooong overdue. Just knowing what column overflowed would be sooo much better.
Fix it, and make the error report useful (please, as always).
Would make life easier
Please fix this
Rob Leggett DBA commented
This would be so helpful to fix. Being able to pinpoint the row and column causing the issue would make resolving this so much easier. I have lost so much time over the years dealing with this error message
Tell me what table and column it is.
"there was an error' is the most unuseful error message it is possible to concieve
There are some ways to research the issue, but the more columns in the table the more work it takes. Researching this type of issue can be both frustrating and time-consuming. Microsoft--PLEASE fix this issue!
Here is an example of type of query we run to help pinpoint the offending column:
SELECT DISTINCT GroupID, LEN(GroupID) FROM db.schm.Membership
WHERE SourceDataKey = 37859
and LEN(groupid) > 12
AND EnrollmentStatusCode IN ('P','N')
GROUP BY GroupID
ORDER BY 2 DESC;
GroupID (No column name)
After finding the offending column, then one has to find the offending row. Once again, this is a time-consuming process--one that could be avoided if Microsoft were to produce a good diagnostic message that pinpoints the source of the data issue.
Not sure what to say that hasn't already been said. How is it this hasn't been fixed already? How many man hours have us users lost trying to find what unnamed column is giving us trouble? Surely more hours that it will take to fix it. Please fix it.
Whenever I have to fix this error in a proc I have to tear the proc down and run it manually. This takes way too long because the error doesn't give the column name that the problem occurred in. It seems like an easy fix to add it.
Steve Dorris commented
Please provide the column name in error. It would be beneficial if you also provided the source and target data lengths.
It should be pretty easy to let us know where the error is so we can fix it pronto!!!
Mike Johnson commented
MS please do the right thing here and give us relief.