Hi all,
I am using SQL compact 3,.5 SP2 on my windows ce 6.0 device.
I need to dynamically create database and a table.
I have no problem creating database, but when I try to create table an error occurs. Can someone please help me out.
CREATE TABLE MYDATA(
[SerialNumber] [nchar](13) NOT NULL,
[Data_ID] [bigint] IDENTITY(1,1) NOT NULL,
[DateTimeEnd] [datetime] NOT NULL,
[Data1] [nvarchar](250) NULL,
[Data2] [nvarchar](250) NULL,
[Data3] [nvarchar](250) NULL,
[CreationDate] [datetime] NULL CONSTRAINT [DF_MYDATA_CreationDate] DEFAULT (getdate()),
CONSTRAINT [PK_MYDATA] PRIMARY KEY CLUSTERED
(
[SerialNumber] ASC,
[Data_ID] ASC,
[DateTimeEnd] ASC
))
If I don't execute the last constraint table is created but when I run it with bolded part SqlCeException with "The constraint specified is not valid" error is thrown.
Best regards,
Grega