-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathupgrade-replication-scri_3.sql
More file actions
40 lines (35 loc) · 1.03 KB
/
upgrade-replication-scri_3.sql
File metadata and controls
40 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- Enable the replication database.
USE [Northwind]
GO
DECLARE @publicationDB AS sysname
DECLARE @publication AS sysname
DECLARE @article AS sysname
SET @publicationDB = N'Northwind'
SET @publication = N'NwdCustomersMerge'
SET @article = N'Customers'
EXEC sp_replicationdboption
@dbname = @publicationDB,
@optname = N'merge publish',
@value = N'true'
-- Add the merge publication.
EXEC sp_addmergepublication
@publication = @publication,
@description = N'Merge publication of Northwind.',
@retention = 14,
@sync_mode = N'native',
@centralized_conflicts = N'true',
@dynamic_filters = N'false',
@keep_partition_changes = N'false'
EXEC sp_addpublication_snapshot
@publication = @publication
-- Add the merge articles.
EXEC sp_addmergearticle
@publication = @publication,
@article = @article,
@source_owner = N'dbo',
@source_object = @article,
@type = N'table',
@description = null,
@column_tracking = N'true',
@schema_option = 0x000000000000CFF1
GO