Groups | Blog | Home
all groups > sql server replication > october 2006 >

sql server replication : alter column of a replicated table?


DallasBlue
10/10/2006 7:09:02 PM
How do I alter the column of the replicated table ?

Paul Ibison
10/11/2006 12:00:00 AM
If you have SQL Server 2005 then alter table will work for most changes. If
it's SQL 2000 then there are some workarounds. Please take a look at these 2
articles:
http://www.replicationanswers.com/AlterSchema2005.asp
http://www.replicationanswers.com/AddColumn.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Hilary Cotter
10/11/2006 10:02:13 AM
For SQL 2000 you have to pipe the values of the column you wish to change to
a temp table along with key information. Then use sp_repldropcolumn to drop
the column and sp_repladdcolumn to add it back with the new width/datatype.
Then push the content back into the base table from the temp table.

For SQL 2005 with replicate_ddl = true by default you can use alter table
statements.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

AddThis Social Bookmark Button