Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Violation of Primary Key constraint error

Status
Not open for further replies.

kav123

Programmer
Joined
Jan 12, 2005
Messages
210
Location
GB
I am getting "Violation of Primary Key constraint '<Name of the constraint>'. Cannot insert duplicate key in object '<Name of the table'", when i run a stored procedure. The error does not come up regularly though. The stored procedure was existing and all i did to it was add an extra parameter to it. No change to table structure of field properties. I am using SQL Server 2000.
 
You are trying to insert the same record twice. Look at the dataset you are trying to insert when you get the error instead of doing an insert and you will see the data that is causing the problem most likely.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top