I am using RMO and some T-SQL to manage my subscriptions and have a need to know if a subscription has been set to reinitialize on next sync.
Asked
Active
Viewed 255 times
2 Answers
1
As far as I know, you can query the table sysmergesubscriptions on the server and check the column sentgen for your subscriber. If it is NULL, it has been marked for reinitialization.

NamingIsHard
- 111
- 1
- 3
0
- Publisher: SQL Server 2016 Standard
- Subscriber: SQL Server 2012 Express
- Subscription Type: Merge Pull
The columns schemaversion
& schemaguid
are set to NULL when a subscription is marked for reinitialization. schemaversion is set to -1 when it's syncing after marked as reinitialization.
SELECT db_name, subscriber_server, schemaversion, schemaguid FROM sysmergesubscriptions

Red
- 26,798
- 7
- 36
- 58

Muhammad Bilal
- 31
- 5