Solved

Modifying table in replication

Posted on 2004-03-25
5
1,262 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
[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
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Viewers will learn how the fundamental information of how to create a table.
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.

737 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