By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Cannot Alter Table being Published for Replication

P: n/a

Hi all,

I'm using SQL Server 2000 SP3 to store data for real time transaction
processing.

I have set up replication to another server using a push subscription to
give me immediate backup.

I need to alter the data type of one of the columns and am using the
following basic sql:
alter table Voucher
alter column SerialNumber varchar(20) NOT NULL

However I keep getting this error message:

Server: Msg 4929, Level 16, State 1, Line 1
Cannot alter the table 'Terminals' because it is being published for
replication.

Is there anything I can do to allow this update taking place, short of
deleting the subscription and recreating it. (I want to try and avoid
this as the same update needs to be applied to about 10 databases that
are also replicated in the same way).

All help is appreciated.

Brian.

*** Sent via Developersdex http://www.developersdex.com ***
Jun 8 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
1) Drop subscription to a specific article that you want to alter,
using sp_dropsubscription.
2) Drop this article using sp_droparticle.
3) Alter your table.
4) Add the article back to publication, using sp_addarticle.
5) Subscribe to this article using sp_addsubscription.
6) Run the snapshot agent to deliver the modified table to the
subscriber.


Brian Wotherspoon wrote:
Hi all,

I'm using SQL Server 2000 SP3 to store data for real time transaction
processing.

I have set up replication to another server using a push subscription to
give me immediate backup.

I need to alter the data type of one of the columns and am using the
following basic sql:
alter table Voucher
alter column SerialNumber varchar(20) NOT NULL

However I keep getting this error message:

Server: Msg 4929, Level 16, State 1, Line 1
Cannot alter the table 'Terminals' because it is being published for
replication.

Is there anything I can do to allow this update taking place, short of
deleting the subscription and recreating it. (I want to try and avoid
this as the same update needs to be applied to about 10 databases that
are also replicated in the same way).

All help is appreciated.

Brian.

*** Sent via Developersdex http://www.developersdex.com ***


Jun 8 '06 #2

P: n/a

"Brian Wotherspoon" <bw**************@yahoo.co.uk> wrote in message
news:zj*************@news.uswest.net...

Hi all,
Try sp_repladdcolumn.

Generally in a case like this, I make it a multi-step process.

sp_repladdcolumn and add say "SerialNumberTemp"

Then update the published table so SerialNumberTemp= SerialNumber.

Then, sp_repldropcolumn on SerialNumber

then add it the way I want.

Then copy the data back

Then drop the temp column.
I'm using SQL Server 2000 SP3 to store data for real time transaction
processing.

I have set up replication to another server using a push subscription to
give me immediate backup.

I need to alter the data type of one of the columns and am using the
following basic sql:
alter table Voucher
alter column SerialNumber varchar(20) NOT NULL

However I keep getting this error message:

Server: Msg 4929, Level 16, State 1, Line 1
Cannot alter the table 'Terminals' because it is being published for
replication.

Is there anything I can do to allow this update taking place, short of
deleting the subscription and recreating it. (I want to try and avoid
this as the same update needs to be applied to about 10 databases that
are also replicated in the same way).

All help is appreciated.

Brian.

*** Sent via Developersdex http://www.developersdex.com ***

Jun 9 '06 #3

P: n/a

"Eugene" <ek*****@gmail.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
1) Drop subscription to a specific article that you want to alter,
using sp_dropsubscription.
2) Drop this article using sp_droparticle.
3) Alter your table.
4) Add the article back to publication, using sp_addarticle.
5) Subscribe to this article using sp_addsubscription.
6) Run the snapshot agent to deliver the modified table to the
subscriber.
Problem with this I believe is that if you go this route, if data in other
articles is modified, when you resubscribe, you'll lose the data or have
problems with it in the other articles.


Brian Wotherspoon wrote:
Hi all,

I'm using SQL Server 2000 SP3 to store data for real time transaction
processing.

I have set up replication to another server using a push subscription to
give me immediate backup.

I need to alter the data type of one of the columns and am using the
following basic sql:
alter table Voucher
alter column SerialNumber varchar(20) NOT NULL

However I keep getting this error message:

Server: Msg 4929, Level 16, State 1, Line 1
Cannot alter the table 'Terminals' because it is being published for
replication.

Is there anything I can do to allow this update taking place, short of
deleting the subscription and recreating it. (I want to try and avoid
this as the same update needs to be applied to about 10 databases that
are also replicated in the same way).

All help is appreciated.

Brian.

*** Sent via Developersdex http://www.developersdex.com ***

Jun 9 '06 #4

P: 1
I have a table called 'cursos' with a field called 'DiasCorridos' nvarchar(50) which i would like to change to 'int'. I can not see through Enterprise manager the name of the publication or the subscriber. So i do not know how to apply this script:
1) Drop subscription to a specific article that you want to alter,
using sp_dropsubscription.
2) Drop this article using sp_droparticle.
3) Alter your table.
4) Add the article back to publication, using sp_addarticle.
5) Subscribe to this article using sp_addsubscription.
6) Run the snapshot agent to deliver the modified table to the
subscriber.
Jul 28 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.