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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Adding NOT FOR REPLICATION to hundreds of tables

Author  Topic 

magictech
Starting Member

44 Posts

Posted - 2004-11-04 : 14:37:16
I'm configuring transaction replication to replicate an entire database that has several hundred tables. Because each of these tables has an IDENTITY column, I need to add NOT FOR REPLICATION to each of these tables in order for replication to work properly. It seems like it would take forever to add NOT FOR REPLICATION on every table in both the publisher and the subscriber. Does anyone out there know of a faster way to accomplish this task? I'm hoping someone might have a script that would add the NOT FOR REPLICATION to the IDENTITY columns. Please help

Thanks is advance

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-11-04 : 17:33:57
Are you sure you need the NOT FOR REPLICATION option? Just because your table has an identity column that doesn't mean you need to use that option.

Tara
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-11-04 : 22:24:44
quote:
Originally posted by magictech

I'm configuring transaction replication to replicate an entire database that has several hundred tables. Because each of these tables has an IDENTITY column, I need to add NOT FOR REPLICATION to each of these tables in order for replication to work properly. It seems like it would take forever to add NOT FOR REPLICATION on every table in both the publisher and the subscriber. Does anyone out there know of a faster way to accomplish this task? I'm hoping someone might have a script that would add the NOT FOR REPLICATION to the IDENTITY columns. Please help

Thanks is advance




i'm not sure i'm reading you right. don't you need to have consistency in your data? why are you choosing not for replication for that certain column? if you're still up to it...

either way you need to invalidate the subscription to have the changes take effect and this will affect all of the articles. my suggestion is to drop the subscribers, issue an alter table command to alter the column properties, you may need to use a cursor and dsql for this though. then just recreate the subscribers, else you can continue what you're doing

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -