I have a bunch of entities which I am replicating from a SQL Server database to a
SQL Server CE database. I would like to know how I can carry the primary keys across
and force them on the CE database without the CE database auto generating a new
primary key. I know I can change the table in CE not to auto increment but to do this
each time I update the CE schema is a mission. How can it be done via code?
run a "SET IDENTITY_INSERT ON" command on the target database before the update - this allows you to insert existing values in to an auto-increment column.
Remember to "SET IDENTITY_INSERT OFF" at the end .