0

I have a bunch of insert querys running and some of them fail with a duplciate entry.

I want to see a log where it says "Error: Duplicate key" and that tells me the EXACT INSERT query that fails so I can see what keys are duplicated.

Thanks

4
Contributors
3
Replies
23
Views
3 Years
Discussion Span
Last Post by Kyle Wiering
0

Well, can't you loop through your queries and validate that the correct data is being inserted? You could break the loop when the error occurs, showing you which data is generating the error.

0

If you are inserting programmatically, you can determine the query failed then log the error and the query that you built to be sent to the server. Of course, you might be inserting a large collection, in which case you will need to use pritaeas' answer.

Edited by Kyle Wiering: print changed to log

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.