Int Id field gets IdentitySeed changed to 0 when I provision a CE database RRS feed

  • Question

  • I have tables in an SqlServer database with an Id field, type Int, default values of 1 for Identity Seed and Identity Increment. When I provision an Sql CE database from my database, the Identity Seed is changed to 0.

    How can I fix it?

    Wednesday, July 7, 2010 11:02 PM


  • Someone in my office found the answer at http://msdn.microsoft.com/en-us/library/bb726019.aspx


    • Identity columns are copied from the server to the client database, but the identity seed and increment are always set to 0 and 1, respectively. This is regardless of how the properties were set in the server database. SQL Server Compact identity columns must have a data type of int or bigint. SQL Server Compact identity columns cannot have a data type of smallinttinyintdecimal, or numeric. For more information about identity columns, see Selecting an Appropriate Primary Key for a Distributed Environment.

    • Marked as answer by wwaters Wednesday, July 7, 2010 11:45 PM
    Wednesday, July 7, 2010 11:45 PM