Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to debug runtime insert/update failures?
Message
De
08/10/2002 07:18:46
 
 
À
03/10/2002 11:15:09
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00706148
Message ID:
00708672
Vues:
16
Bob,

Thanks. I will look into it and let you know

David

>I am pretty sure you can do this with SQL Profiler. You will need to set it to report more than the default, which would just show the one update command.
>
>BOb
>
>
>>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform