Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Merge replication - schema script could not be propagated to the subscriber

$
0
0

Hi

I see lots of references to this problem that have to do with permissions but I don't think that's it here...

I added a couple of columns to a table, and added a default value for one.  A little later I didn't like the way I had done it and dropped the columns.  Then I added them again the way I really meant to in the first place. 

The rest of the error says:

Error messages:
The schema script ' if exists (select * from syscolumns where name = N'Col1' and id = object_id(N'[dbo].[tbl1]'))  if exists (select * from syscolumns
where name = N'Col2' and id = object_id(N'[dbo].[tbl1]')) if object_id(N'[dbo].[tbl1]') is not null exec('ALTER TABLE [dbo].[tbl1]
DROP COLUMN Col2, Col1')' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
The object 'DF_tbl1_Col2' is dependent on column 'Col2'. (Source: MSSQLServer, Error number: 5074)
Get help: http://help/5074
ALTER TABLE DROP COLUMN Col2 failed because one or more objects access this column. (Source: MSSQLServer, Error number: 4922)
Get help: http://help/4922

I've tried reinitializing and that didn't help.  I tried stopping synchronization and removing the article that is this table and then going back and removing the columns from the publisher and the subscriber separately.  But when I add the article back in and restart synchronization (with a new snapshot), the columns end up added back in already before the offending code tries to run.

It looks, in fact, like the order of execution of the DDL statements can end up out of sequence.  When trying to start from a new snapshot as described above, I found it choking on another table where it said that the schema of the tables in the two databases weren't compatible.  In this instance, I had added Field1 to a table, then came back and added Field2 and Field3.  But in some (not all) of the subscription databases the fields were added in the order Field2, Field3, Field1.  This is a bit scary to me...

Can someone please give me a clue what I need to do here?

Thank you!!!


Viewing all articles
Browse latest Browse all 4054

Trending Articles