Groups | Blog | Home
all groups > sql server replication > october 2006 >

sql server replication : Script code for "Reinitialize All Subscripers" function SQL 2005


RU Developer
10/19/2006 8:08:02 AM
Hello All

We are running Merge replication on SQL 2005 with Pocket PC Clients.

My question is, can i script (T-SQL) the same function as if i rightclick on
the Replication Publication, and select "Reinitialize All Subscripers" and
then click on "Create New SnapShot" + "Upload Changes"?

Which system stored procedures should i use? I need to do the same just with
T-SQL.

zerg2k NO[at]SPAM yahoo.com
10/19/2006 12:21:21 PM
or sp_reinitpullsubscription if you have pull subscriptions :)

[quoted text, click to view]
Hilary Cotter
10/19/2006 1:01:31 PM
use sp_reinitsubscription
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

RU Developer
10/20/2006 2:39:01 AM
I have tried running sp_reinitsubscription, with success but it does not make
the same changes as "Reinitialize All Subscribers".

Example if i run [sys].[sp_reinitmergesubscription] @publication = N'PE04',
@upload_first = N'true'

and then manually start the "SNAPSHOT AGENT" from within MSSQL Server
Management Studio it takes about 3 seconds.

But if i klick the "Reinitialize All Subscribers" from MSSQL Server
Management Studio and then manually start the "SNAPSHOT AGENT" from within
MSSQL Server Management Studio it takes about 40 seconds.

I can also see the changes is not the same in the Pocket PC. So the
"Reinitialize All Subscribers" from within MSSQL Server Management Studio has
to do something else than just executing the sp_reinitmergesubscription

I have also tried to look for any logs that might could show what commands
they fire but without any luck.

If any can guide me in the right direction.

Thanks

[quoted text, click to view]
AddThis Social Bookmark Button