• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 900
  • Last Modified:

SQL Server 2008 R2 Remove Not for Replication

I initially set up replication temporary and it removed.  

Now we've noticed the id columns have ‘FOR REPLICATION’, immediately we executed sp_removedbreplication ‘dbname’.

After executing the sp, the id column now have ‘NOT FOR REPLICATION’.  

How do you get rid of this NOT FOR REPLICATION from my id columns?


e.g.

(id)     INT       IDENTITY  (1,1)  NOT FOR REPLICATION NOT NULL,
0
Favorable
Asked:
Favorable
6 Solutions
 
Matt BowlerDB team leadCommented:
Is there an issue with having this there?
0
 
FavorableAuthor Commented:
Is an issue when doing schema compare inside of visual studio 2012.

Is there a way to turn if off for all table identity columns in the database?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Matt BowlerDB team leadCommented:
alter table tablename alter column columnname drop not for replication
0
 
FavorableAuthor Commented:
do you have to repeat for over one thousand objects in the database?
0
 
Anthony PerkinsCommented:
do you have to repeat for over one thousand objects in the database?
You don't have to repeat it that many time you just need to execute it that many times.
0
 
Matt BowlerDB team leadCommented:
Run this in the database. The output will be all of the alters that need to be run...

select
      'alter table ' +
      object_name([object_id]) +
      ' alter column ' +
      name +
      ' drop not for replication'
from sys.identity_columns where is_not_for_replication = 1
0
 
Matt BowlerDB team leadCommented:
Has this been answered?
0
 
FavorableAuthor Commented:
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now