I'm trying to create a composite primary key like 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 some reason, the second query is generating the following exception:
System.Data.SqlServerCe.SqlCeException occurred Message=The constraint specified is not valid. Source=SQL Server Compact ADO.NET Data Provider HResult=-2147217900 NativeError=25505
This happens when I run my project from 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 help please?