Solved

Modifying table in replication

Posted on 2004-03-25
5
1,257 Views
Last Modified: 2008-02-01
How can I easily rename fields in a table and not have trouble with replication?

--------------------------------------------------------------------------
'tblMyTable' table
- Unable to rename column from 'OldVal' to 'NewVal01'.  
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot rename the table because it is published for replication.
--------------------------------------------------------------------------

0
Comment
Question by:risoy
  • 3
  • 2
5 Comments
 
LVL 13

Accepted Solution

by:
danblake earned 250 total points
ID: 10675294
Remove the table from the replicated setup, by using sp_droparticle, then rename the table/column and then readdit afterwards with sp_addarticle.

You can generate the sp_droparticle/sp_addarticle scripts by clicking in EM, the subscription database which the table is involved in and select generate sql script for create/drop to just grab the bits relating to this particular table with the drop/adds required.
0
 

Author Comment

by:risoy
ID: 10687627
Ergo there is no option while the table is in replication?
0
 
LVL 13

Expert Comment

by:danblake
ID: 10687707
That is correct.

You can drop the column then add the column (but this messes up the underlying table structures involved by using):
sp_repldropcolumn
sp_repladdcolumn

But you cannot rename fields without taking it out of the replication.

MS SQL Server does not support automatic full blown schema updates to multiple sites.
0
 

Author Comment

by:risoy
ID: 10688257
Could be handy in a redundant system that require 100% uptime. Hopefully in the future.

Thank you!
0
 
LVL 13

Expert Comment

by:danblake
ID: 10688463
Could be handy in a redundant system that require 100% uptime. Hopefully in the future.

Hopefully I'll get the chance to design something like this: using the Service Broker in Yukon / Trigers / and some other bits / bobs ....(I believe it can be made to work)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now