String or binary data would be truncated c#
If you're running several, you could watch profiler and look at the last completed statement and see what the statement after that might be, though I have no idea if that approach is feasible for you. Mark the post as answer, if it helps you. Generally it is that you are inserting a value that is greater than the maximum allowed value.
In general, there isn't a way to determine which particular statement caused the error. String or binary data would be truncated Ask Question. Next; commm. Aug 05,
Nick DeVore, the question is vague, doesn't explain the context, and leave a lot to guess at. SQL is processing the whole statement, so it's out of the hands of the code. I have a C code which does lot of insert statements in a batch. CodeMonkey 7, 15 60 Last post Aug 05,
The statement has been terminated. Next. To find out the which insert statement caused this, I need to insert one by one in the SQLServer until I hit the error. If you're running several, you could watch profiler and look at the last completed statement and see what the statement after that might be, though I have no idea if that approach is feasible for you.
This information was useful to me. Apr 22 '09 at When you got the message, please check size of every parameter and make sure they are in the range of corresponding field. According to money and smallmoney Transact-SQLthe range of money is from ,, The statement has been term
Apr 23 '09 at All as one call, or as individual calls within a transaction? Mar 26 at If one large call, then no.
Add " Country", SqlDbType. This will create a table called MyTempTable in your DB that you can compare to your target table structure i. While executing these statements, I got "String or binary data would be truncated" error and transaction roledback. Aug 04, It could also be because you're trying to put in a null value back into the database.