I have a local (compact 3.5) sql database file which I am currently trying querying using a program called Compact Query. I am trying to create two tables using SQL – here is the code:
CREATE TABLE List(
ListId int IDENTITY(1,1) NOT NULL,
ShortDesc varchar(50) NOT NULL,
ActiveInd bit NULL,
CONSTRAINT PK_List PRIMARY KEY CLUSTERED
(
ListId ASC
))
CREATE TABLE CustomerList(
CustomerListId int IDENTITY(1,1) NOT NULL,
CustomerId int NULL,
ListId int NULL,
CONSTRAINT PK_CustomerList PRIMARY KEY CLUSTERED
(
CustomerListId ASC
))
When I run this SQL, it returns the following error:
The constraint specified is not valid. [0, 0, 0,,,]
Any ideas?
For those who google this question looking for an answer – I have figured it out myself.
If the above SQL create statements don’t work (as they have previously done in SQL Server Management Studio), then try this:
Hope this helps anyone who encounters the same problem.