dbTalk Databases Forums  

Add new column to a replicated table..

microsoft.public.sqlserver.programming microsoft.public.sqlserver.programming


Discuss Add new column to a replicated table.. in the microsoft.public.sqlserver.programming forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SPG
 
Posts: n/a

Default Add new column to a replicated table.. - 02-16-2005 , 07:47 AM






Hi,

I need to add a column to a table that is being replicated.

Can I just do the ALTER TABLE ADD xxxx bit then make a call out to
sp_replAddColumn?

When I do so, the sp fails saying the column exists. The manual says that it
adds the column to the publications, but does not suggest it does the
physical add tot the table..

Thanks in advance,

SPG



Reply With Quote
  #2  
Old   
Wayne Snyder
 
Posts: n/a

Default Re: Add new column to a replicated table.. - 02-16-2005 , 07:53 AM






You use sp_replAddColumn INSTEAD of using alter table add column.... the Sp
adds the column to the table, and fixes replication... since you manually
added the column the sp fails..... drop the column and use the SP only.

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

"SPG" <steve.nospoo.goodsell (AT) nopooblueyonder (DOT) co.nopoo.uk> wrote

Quote:
Hi,

I need to add a column to a table that is being replicated.

Can I just do the ALTER TABLE ADD xxxx bit then make a call out to
sp_replAddColumn?

When I do so, the sp fails saying the column exists. The manual says that
it adds the column to the publications, but does not suggest it does the
physical add tot the table..

Thanks in advance,

SPG




Reply With Quote
  #3  
Old   
SPG
 
Posts: n/a

Default Re: Add new column to a replicated table.. - 02-16-2005 , 08:03 AM



Thanks for that..
I sort of half guessed that when the sp failed, but the docs are not too
clear on this..

Steve
"Wayne Snyder" <wayne.nospam.snyder (AT) mariner-usa (DOT) com> wrote

Quote:
You use sp_replAddColumn INSTEAD of using alter table add column.... the
Sp adds the column to the table, and fixes replication... since you
manually added the column the sp fails..... drop the column and use the SP
only.

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

"SPG" <steve.nospoo.goodsell (AT) nopooblueyonder (DOT) co.nopoo.uk> wrote in message
news:r9IQd.16027$8B3.14345 (AT) text (DOT) news.blueyonder.co.uk...
Hi,

I need to add a column to a table that is being replicated.

Can I just do the ALTER TABLE ADD xxxx bit then make a call out to
sp_replAddColumn?

When I do so, the sp fails saying the column exists. The manual says that
it adds the column to the publications, but does not suggest it does the
physical add tot the table..

Thanks in advance,

SPG






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.