I have a table which has got an IDENTITY COLUMN. There is another column in the same table which is primary key.
When user inserts a new record, I don't check for the uniqness of the value inserted for the primary key field.
Instead I capture the error code when SQL server throws primary key constraint error (if a duplicate entry is made.).
It works fine...The problem is that, When a duplicate entry is made, the record is not entered...
but IT INCREASES THE IDENTITY COLUMN by 1. I don't want this. Am using the IDENTITY column value for display also.
So I want it in sequece. Is there any solution to this problemm.?
(ie, Identity column value should not be increased if there is any pbm in insertion of record.)
Thanks in advance,