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!

IGNORE DUPLICATE PRIMARY KEYS

Status
Not open for further replies.

Lambro

Programmer
Joined
Aug 22, 2001
Messages
258
Location
US
I'm using SQL 2000. I have a primary key field which I need to enter 'NETPRICES' for every row. I get the error message "Can not insert duplicate key in object IV00401 which is my table." I need to keep this field as a primary key field because it's part of Microsoft Great Plains Software. I have about 1200 records I need to insert into this table all having the same primary key. How can I do this? Thanks
 
You can't. The most fundamental property of primary keys is that they cannot contain duplicates.

You must define somethings else a primary key, maybe using a column with identity property.
 
You must define somethings else a primary key, maybe using a column with identity property.

Not a good idea: the PK is defined as it is for the purposes of the Great Plains software. Lambro's first priority should be to avoid screwing up the software that already works.

Lambro: there's something faulty about what you're trying to do. We don't have enough information to help you yet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top