SQL Server - Composite key creation -
i'm trying create composite primary key this:
create table tablea (column1 nvarchar(50) not null, column2 nvarchar(3) not null, column3 nvarchar(50) not null) alter table tablea add constraint pk_auxgroupdata primary key clustered (column1 , column2)
by reason, second query generating following exception:
system.data.sqlserverce.sqlceexception occurred message=the constraint specified not valid. source=sql server compact ado.net data provider hresult=-2147217900 nativeerror=25505
this happens when run project microsoft visual studio 2010 in debug mode.
my development machine has:
- microsoft sql server 2008 compact 3.5 sp2 enu
- microsoft sql server 2008 compact 3.5 sp2 x64 enu
any please?
unfortunately, sql server compact edition not support clustered indexes. goes primary key well.
link showing not support clustered indexes:
- http://technet.microsoft.com/en-us/library/ms345331(v=sql.105).aspx
link showing primary keys maintained unique indexes:
- http://technet.microsoft.com/en-us/library/ms173393.aspx
Comments
Post a Comment