Solved

SQL Server 2008 R2 Remove Not for Replication

Posted on 2013-05-20
9
742 Views
Last Modified: 2013-07-10
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
Comment
Question by:Favorable
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 29

Assisted Solution

by:QPR
QPR earned 83 total points
ID: 39182561
0
 
LVL 10

Assisted Solution

by:Matt Bowler
Matt Bowler earned 334 total points
ID: 39182944
Is there an issue with having this there?
0
 

Author Comment

by:Favorable
ID: 39183275
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 10

Assisted Solution

by:Matt Bowler
Matt Bowler earned 334 total points
ID: 39183282
alter table tablename alter column columnname drop not for replication
0
 

Author Comment

by:Favorable
ID: 39184326
do you have to repeat for over one thousand objects in the database?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 83 total points
ID: 39185843
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
 
LVL 10

Assisted Solution

by:Matt Bowler
Matt Bowler earned 334 total points
ID: 39185854
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
 
LVL 10

Accepted Solution

by:
Matt Bowler earned 334 total points
ID: 39272465
Has this been answered?
0
 

Author Closing Comment

by:Favorable
ID: 39314974
thanks
0

Featured Post

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question