Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

sql script (access)

I'm trying to create a table with a combined primary key, officeID and listingDetailsID. I get an error "primary key already exists"

Please help...

This works:

CREATE TABLE eraLISTINGDETAILS (officeID INTEGER, listingAgentID INTEGER, address TEXT (255), photoPath TEXT (255), listingPrice CURRENCY, sellerDimensionID INTEGER, dataSaved DATETIME, dataDate TEXT (20), dataStatus TEXT (1), listingDetailsID INTEGER CONSTRAINT primConstraint1 PRIMARY KEY)

This does not...but I want a combination of the two fields as a primary key.

CREATE TABLE eraLISTINGDETAILS ( listingAgentID INTEGER, address TEXT (255), photoPath TEXT (255), listingPrice CURRENCY, sellerDimensionID INTEGER, dataSaved DATETIME, dataDate TEXT (20), dataStatus TEXT (1), listingDetailsID INTEGER CONSTRAINT primConstraint1 PRIMARY KEY, officeID INTEGER CONSTRAINT primConstraint2 PRIMARY KEY)

Thanx.
Sign In or Register to comment.