SQLException : String or binary data would be truncated

前端 未结 12 876
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 06:41

I have a C# code which does lot of insert statements in a batch. While executing these statements, I got \"String or binary data would be truncated\" error and transaction r

12条回答
  •  情深已故
    2020-11-27 07:33

    It depends on how you are making the Insert Calls. All as one call, or as individual calls within a transaction? If individual calls, then yes (as you iterate through the calls, catch the one that fails). If one large call, then no. SQL is processing the whole statement, so it's out of the hands of the code.

提交回复
热议问题