SQL Server Developer Center > SQL Server Forums > SQL Server Compact > Can I reseed Identity field of replicated table (at subscriber)
Ask a questionAsk a question
 

AnswerCan I reseed Identity field of replicated table (at subscriber)

  • Friday, November 06, 2009 11:57 AMsmomair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Can an identity value be reseeded to its inital value, provided that the table is in subscriber db (Sql Server Ce) under replication.
    If yes, then how? as this statement cannot be executed over Sql Server Ce. 
    DBCC CHECKIDENT(ALaCarte, RESEED, 2001)
    
    Omair Imran, S. M.
    9221

Answers

All Replies

  • Friday, November 06, 2009 1:48 PMErikEJMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You can reseed as described here: http://social.msdn.microsoft.com/forums/en-US/sqlce/thread/7b3d4664-a49b-4874-9091-75ee5909988c/

    I don't think you can do this on a replicted table, tough. Generally, I avoid identity columns in merge replication, but use uniqueidentifier instead.
    http://erikej.blogspot.com Erik Ejlskov Jensen - Please mark as answer, if this was it.
    • Marked As Answer bysmomair Friday, November 06, 2009 3:37 PM
    •  
  • Friday, November 06, 2009 3:39 PMsmomair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Many thanks

    It worked over replicated table. All I needed to do is to bring the compact db to workstation from the hand held and execute the script and move it back. Later on the new transaction were successfully performed as well as synchronized.

    Thanks

    Omair Imran
    9221