Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

ODBC--call failed.

Question posted by: draketickner (Newbie) on July 24th, 2008 05:01 PM
Recently our database team member left and we have had this issue come up which I am trying to understand. The error is below, it comes up when we try to add a project entry under our Order Entry and ask for the Order Status.



ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint 'blah'. Cannot insert duplicate key in object 'alsoblah'. (#2627) The statement has been terminated. [Microsoft][ODBC SQL Server Driver][SQL Server] (#3621)
Delerna's Avatar
Delerna
Expert
557 Posts
July 25th, 2008
04:03 AM
#2

Re: ODBC--call failed.
That error means that you are trying to add a record to a table that is already there.
For example
Say you have a table that has one key field called OrderID
and in that table there is a record for OrderID 1001

If you now try to add an order to the table with orderID 1001
you will get the error you are getting.
Primary key constraints ensure that every record in your table is unique

Reply
debasisdas's Avatar
debasisdas
Moderator
6,576 Posts
July 25th, 2008
12:43 PM
#3

Re: ODBC--call failed.
The error message is self explanatory.

you need to check if the data already exists before inserting that to database tables.

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,798 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft SQL Server Contributors