Question : Ignore/Supress #2601 (Attempt to insert duplicate key row in object 'insert_table' with unique index 'insert_table_idx1')

I'd like to ignore or suppress the #2601 - dup key insert message,
within a stored procedure itself, that is without having to change the
Java or C code that calls the stored procedure.

Anyone out there know how ?

Thanks.
Adam

Answer : Ignore/Supress #2601 (Attempt to insert duplicate key row in object 'insert_table' with unique index 'insert_table_idx1')

The question is what you want to do if there is duplicate entry ? will you update it ?
Then do update first, check @@rowcount , if it is 0 do insert.

Do you have clustered index on this table that will distribute inserts from last page ? In case you have insert contention for last page.
Row level locking may be another option to decrease contenction.
You can use sp_object_stats to evaluate lock contention in database.
Random Solutions  
 
programming4us programming4us