Tuesday, 10 September 2013

Is there a way to determine which column causes error?

Is there a way to determine which column causes error?

I am working on a C# project that gathers data from different sources and
stores the data in a SQL Server database. I sometimes get String or binary
data would be truncated. error which is very annoying. I want to determine
which column causes this error and log it. Is there another way than
checking parameter lengths?
What I did is if the column is varchar(50), checking if data length is
greater than 50. I feel like this is like a walkaround and wonder if there
is any other neat solution.

No comments:

Post a Comment