Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to debug runtime insert/update failures?
Message
From
30/09/2002 19:53:11
 
 
To
30/09/2002 17:22:23
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00706148
Message ID:
00706179
Views:
22
I don't know of a way but if it continues to be a problem, use you duplicate checking routine to remove duplicates BEFORE doing the insert.

-Mike

>I am wondering if there is a way to effectively debug a failing (at runtime - not at compile time) transact sql insert or update statement that updates multiple (possibly thousands or hundreds of thousands) of rows, such that one can know at exactly what point, or what row it failed on. For example in an 'insert into from' statement such as below:
>
> /* update soshiph */
> insert into ms501.dbo.soshiph
> () from ms501.dbo.arinvc
>
>I am getting the error that SQL Server can't insert a duplicate primary key.
>I can go to the source table - arinvc - and run a dupe checking routine - and eliminate the dupes, and run again. But what I am wondering is whether I can determine the specific key value that it is failing on - is there some buffered value or values for the row sql server is attempting to operate on, in a variable. I don't know how to use the sql debugger - would this help?
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform