Sorry if this is a bit off-topic but I wasn't sure where to put this.I'm using SQLCE 3.5I have a table that is storing an order list with 2 fields, ID and Description. ID is sequentailly numbered and is also the primary key.I want to insert 2 extra items in the middle of the list (before item 5, let's say) and run the following query:UPDATE myTableSET Id=Id+2WHERE Id>=5To move all items greater than 5 'up' 2 places so I can then insert the new records. However, I get the following error message:Major Error 0x80040E2F, Minor Error 25016> UPDATE myTableSET Id=Id+2WHERE Id>=5A duplicate value cannot be inserted into a unique index. [ Table name = myTable,Constraint name = PK_myTable ]I understand that it's trying to 'move' the items into already existing places but why? When using the full SQL Server it batch processes and handles this fine. Am I doing something wrong here or is there a way around this?Many thanksAlanCREATE TABLE myTable( Id int NOT NULL, Description nvarchar(150) NULL CONSTRAINT PK_myTable PRIMARY KEY ( RouteStopId ))GOINSERT INTO myTable(Id, Description)SELECT 1, 'Description 1' UNIONSELECT 2, 'Description 2' UNIONSELECT 3, 'Description 3' UNIONSELECT 4, 'Description 4' UNIONSELECT 5, 'Description 5' UNIONSELECT 6, 'Description 6' UNIONSELECT 7, 'Description 7' UNIONSELECT 8, 'Description 8' UNIONSELECT 9, 'Description 9' UNIONSELECT 10, 'Description 10'
Alan