Saturday, February 25, 2012

alter column of a replicated table?

How do I alter the column of the replicated table ?
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 .
|||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
"DallasBlue" <DallasBlue@.discussions.microsoft.com> wrote in message
news:D3070003-28E4-4568-93FC-7A2E4DF94B39@.microsoft.com...
> How do I alter the column of the replicated table ?
>

No comments:

Post a Comment