Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9219451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:07:12+00:00 2026-06-18T03:07:12+00:00

I have a local (compact 3.5) sql database file which I am currently trying

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:07:13+00:00Added an answer on June 18, 2026 at 3:07 am

    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:

    CREATE TABLE List(
    ListId int IDENTITY(1,1) NOT NULL CONSTRAINT PK_List PRIMARY KEY,
    ShortDesc nvarchar(50) NOT NULL,
    ActiveInd bit NULL)
    
    CREATE TABLE CustomerList(
    CustomerListId int IDENTITY(1,1) NOT NULL CONSTRAINT PK_CustomerList PRIMARY KEY,
    CustomerId int NULL,
    ListId int NULL)
    

    Hope this helps anyone who encounters the same problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SQL Compact edition database as a local file. I'm using Visual
I have deployed a windows setup file with compact SQL db (local database). Now
I have a local Microsoft SQL Server Compact 3.5 database (.sdf) in my WPF
I have a local, SQL Server Compact database in an application I am creating.
I have a local Database running on localhost:3306, which I access with MySQL Workbench.
I have created a website on azure running Orchard CMS using a SQL Compact
I have right clicked on App_Data and added a new SQL Server Compact Local
I have created a custom task that is used to create SQL compact databases
I have a local branch named ' my_local_branch ', which tracks a remote branch
we have a local staging server running sql server 2000 and a remote public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.