Update replicated tables

  • Hi Guys,

    I have copied the mdf and ldf of a replicating db (publisher) in order to do a sp_attach_db on a new server. This I have done successfully, but now I want to continue developing this db and I am having difficulty adding new columns to the tables as it still thinks it is a replicating db.

    I understand that once a db is replicating one cannot edit the table structure as usual but why does it still think it is a publisher on the new server?

    Thanks for any suggestions

    Adrian Michalski

  • I don't have a good answer for you.  That is, (as far as I know) it gets really tricky to change the replication settings on a db once you've copied it in this manner to another place.

    My solution when I was dealing with this issue was to manually drop all the replication before making a copy of the database.  Aside from that you can try and copy table data, to a new table then drop the old and rename the new.  But if you have declared RI, that can get tricky as well.

     

  • Have you tried this:

    If you attach a database to a server other than the server from which the database was detached, and the detached database was enabled for replication, you should run sp_removedbreplication to remove replication from the database

     

    PRW.

    Paul R Williams.

  • You can also run sp_dboption 'databasename', 'published', 'false'. 

     

    By the way, you can add columns to replicated databases but only thru the replication Wizard.  See BOL topic replication> schema changes.

     

    Good luck!  TW


    Kindest Regards,

    TW

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply