sp_executesql Error Trapping

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • craigmold
    New Member
    • Jul 2007
    • 2

    sp_executesql Error Trapping

    Hi Guys,

    I'm new to this forum, so please be gentle!

    I'm running bulk insert dynamically using sp_executesql. I've setup error handling in the dynamic code. It works when all is well, however when I get an error such as this...

    Bulk Insert data conversion error (truncation)... .

    The process just fails and doesn't give me a return value.

    How can I trap these errors so that I can make sure I know when something has failed? Or is this just not possible?

    Cheers
    C
  • craigmold
    New Member
    • Jul 2007
    • 2

    #2
    Me Again,

    Actually, How do I stop this error from terminating the batch, and therefore my stored procedure? If I can stop the OLEDB Stream from quitting the batch, I can update a table with 0 (in the batch code) and then test the result of this in the stored proc after the dynamic sql has finished.

    Cheers
    C

    Comment

    Working...