Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 identity column in sp and replication how to solve

Author  Topic 

ann06
Posting Yak Master

171 Posts

Posted - 2010-10-28 : 04:35:17
hi,
i have a table with Id column, a sp inserts to this table without specifying the column name.
when configuring replication its failing to apply initial snapshot error as:
Insert Error: Column name or number of supplied values does not match table definition.
this is because i suppose it marked the id column to not for replication option so the subscriber not able to give a value at the insert check.
how to got around am i missing an option to set ?

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-28 : 10:26:58
remove the not for replication directive. or can specify columns to be replicated
Go to Top of Page

ann06
Posting Yak Master

171 Posts

Posted - 2010-10-30 : 09:56:36
the problem it was am not listing the columns when inserting so when merge replication added the rowguid column the sp fails everytime.
its not related to the not for replication error.
although i couldn't find what the diff. btwn the identity:yes and identity:yes not for replication.
configuring either at the subscriber are generating new ids when adding new rows, shouldn't the second one disable the new id at the subscriber?

thanks folks
Go to Top of Page
   

- Advertisement -