Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to debug runtime insert/update failures?
Message
De
30/09/2002 17:22:23
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
How to debug runtime insert/update failures?
Divers
Thread ID:
00706148
Message ID:
00706148
Vues:
58
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform