Showing posts with label alter. Show all posts
Showing posts with label alter. Show all posts

Friday, March 9, 2012

Merge Replication Failed - Urgent Please

I have two databases A & B which have a merge replication between them. Both are live data. I wanted to alter table in db A, so i deleted subscription and altered the table from db A. After that i rebuilt the replication between A & B with initialization but now my replication fails. Every time i get different error messages..recently i get message of 'Subscriber failed to initialize'. Could anyone suggest how to resolve this? Urgent please.

Hello,

Which one is the subscriber, A or B?

What kind of alter table did you perform, such as add/drop column or change the definition of the table?

After the ALTER TABLE, the table schema is different from each other, right?

When the replication was rebuilt, was it a pull subscription or push subscription?

Thanks.

This posting is provided AS IS with no warranties, and confers no rights

|||A is the publisher and B is the subscriber. I alter the table with increasing the datatype width from 9-50 varchar. After update the schema of A is different from each other. Replication is push from publisher.|||

Try this -

Alter the table on A back to what it was.

Set up the replication with NoSync scenario, as @.sync_type = 'NONE' in the sp_addmergesubscription (see http://msdn2.microsoft.com/en-us/library/ms187717.aspx).

Make a dummy sync.

Alter table again on A to increasing the width of the desired datatype

Sync again.

Thanks,

This posting is provided AS IS with no warranties, and confers no rights

Monday, February 20, 2012

Merge Replication and altering tables

I have a couple of SQL 2000 servers that are using Merge replication and
need to alter a table. Can I alter a table on one and have that alteration
replicate, for example, if I change the field length or add an index?
If I add a column to a table, I assume that I would have to add that column
to the subscription, correct?
Thanks
Robert,
if you use sp_repladdcolumn on the publisher, it will propagate to the
subscriber.
Regards,
Paul Ibison

Merge Replication and altering tables

I have a couple of SQL 2000 servers that are using Merge replication and
need to alter a table. Can I alter a table on one and have that alteration
replicate, for example, if I change the field length or add an index?
If I add a column to a table, I assume that I would have to add that column
to the subscription, correct?
ThanksRobert,
if you use sp_repladdcolumn on the publisher, it will propagate to the
subscriber.
Regards,
Paul Ibison

Merge Replication and altering tables

I have a couple of SQL 2000 servers that are using Merge replication and
need to alter a table. Can I alter a table on one and have that alteration
replicate, for example, if I change the field length or add an index?
If I add a column to a table, I assume that I would have to add that column
to the subscription, correct?
ThanksRobert,
if you use sp_repladdcolumn on the publisher, it will propagate to the
subscriber.
Regards,
Paul Ibison

Merge Replication Alther Column in Place

Hi all i have a merge replication am im trying to alter a column in place,
ive got an article from sql server cental, that describes creating a temp
column copy the data over drop and recrete the column, copy the data over
and drop the temp column,
Step 1
exec sp_repladdcolumn @.source_object = 'authors'
,@.column = 'TempTest'
,@.typetext = 'varchar(100) NULL'
,@.publication_to_add = 'pubs'
This works ok
Step 2
update authors set TempTest = Test
This works ok
Step 3
exec sp_repldropcolumn @.source_object = 'authors'
,@.column = 'Test'
But this gives an error
Warning: only Subscribers running SQL Server 2000 can synchronize with
publication 'pubs' because schema replication is performed.
Server: Msg 5074, Level 16, State 1, Line 1
The object 'DF__authors__test__186C9245' is dependent on column 'Test'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN Test failed because one or more objects access this
column.
Can anyone help please, how can i drop this object, to let me drop the
column.
Thanks Andrew
You first have to drop default contraint which is causing the problem
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"andrew bourne" <andrewbourne@.vardells.com> wrote in message news:eZuBH8UVFHA.3584@.TK2MSFTNGP14.phx.gbl...
Hi all i have a merge replication am im trying to alter a column in place,
ive got an article from sql server cental, that describes creating a temp
column copy the data over drop and recrete the column, copy the data over
and drop the temp column,
Step 1
exec sp_repladdcolumn @.source_object = 'authors'
,@.column = 'TempTest'
,@.typetext = 'varchar(100) NULL'
,@.publication_to_add = 'pubs'
This works ok
Step 2
update authors set TempTest = Test
This works ok
Step 3
exec sp_repldropcolumn @.source_object = 'authors'
,@.column = 'Test'
But this gives an error
Warning: only Subscribers running SQL Server 2000 can synchronize with
publication 'pubs' because schema replication is performed.
Server: Msg 5074, Level 16, State 1, Line 1
The object 'DF__authors__test__186C9245' is dependent on column 'Test'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN Test failed because one or more objects access this
column.
Can anyone help please, how can i drop this object, to let me drop the
column.
Thanks Andrew