cancel
Showing results for 
Search instead for 
Did you mean: 

altering publication in SQL17 (Mobilink)

Baron
Participant
0 Kudos
1,141

Could somone tell me why some old functions dont work anymore in SQL17?

I have an existing publication and I want to exclude some table from it.

In the previous versions it worked as:

ALTER PUBLICATION mypub DELETE TABLE mytable

With SQL17 it tells me that such a change should be done within SCHEMA CHANGES, and this keyword leads me to the ALTER SYNCHRONIZATION SUBSCRIPTION statement, but here I can't add or delete any table to an existing publication!!

Any hints please?

Accepted Solutions (0)

Answers (1)

Answers (1)

chris_keating
Product and Topic Expert
Product and Topic Expert

From the ALTER PUBLICATION documentation:

When altering a MobiLink publication, an article can only be dropped after the execution of a START SYNCHRONIZATION SCHEMA CHANGE statement.

The SYNCHRONIZATION SCHEMA CHANGE is a new feature added in version 12.

regdomaratzki
Product and Topic Expert
Product and Topic Expert

Here's a simple example that shows an ALTER PUBLICATION that adds the data2 column to the admin table on the p1 publication, all wrapped around START/STOP SYNCHRONIZATION SCHEMA CHANGE commands.

start synchronization schema change for tables "Admin" set script version = 'v17.1';

alter table Admin add data2 varchar(64) default NULL;
alter publication p1 alter table Admin ( admin_id, data, data2 );

stop synchronization schema change;