Friday, March 9, 2012

Identity Columns on replicated data

CREATE TABLE SALES
(sale_id INT IDENTITY (1,1),
sale_region CHAR(2) )
When replicated, the IDENTITY property is lost. If the Publisher crashed and
I wanted to restore the replicated data off the subscriber, I could manually
edit the table and turn on the IDENTITY property under Enterprise Manager. Is
there another way? I can not find a way to do this with the ALTER TABLE
statement. TIA
The best way is to use a custom script in sp_addarticle to put the identity
property with the NFR clause on the subscriber.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Greg" <Greg@.discussions.microsoft.com> wrote in message
news:95BE6E91-BDD0-4893-9FB8-47F6F92017B9@.microsoft.com...
> CREATE TABLE SALES
> (sale_id INT IDENTITY (1,1),
> sale_region CHAR(2) )
> When replicated, the IDENTITY property is lost. If the Publisher crashed
> and
> I wanted to restore the replicated data off the subscriber, I could
> manually
> edit the table and turn on the IDENTITY property under Enterprise Manager.
> Is
> there another way? I can not find a way to do this with the ALTER TABLE
> statement. TIA

No comments:

Post a Comment