Results 1 to 4 of 4

Thread: Identifying when the re-initialise process on subscription is finished

  1. #1
    Join Date
    Mar 2007
    Posts
    27

    Arrow Identifying when the re-initialise process on subscription is finished

    Morning,
    I’m controlling me transactional replication with scripts

    Distributor and publisher are on the same box (SQL Server 2005 Enterprise)

    I run the following code on publisher box

    declare @JobName varchar(1000),
    @PublicationName varchar(1000),
    @SubscriberName varchar(1000)
    select @PublicationName='Publication_Other_Objects',
    @SubscriberName='SRV-SUB-DB01

    select @JobName=name from distribution..MSsnapshot_agents where publication=@PublicationName
    exec mydb..sp_reinitsubscription
    @publication = @PublicationName ,
    @subscriber = @SubscriberName,
    @invalidate_snapshot =1

    exec msdb..sp_start_job @job_name=@JobName


    and as the result the a new snapshot will be taken and the subscribtion will be re-initialised
    I need to find out when the bulk inserts(re-initialise) on subscription is finished, so I can kick off another process.
    At the moment the only why for me to find out is to use replication monitor
    Is there any dmv that I can use to extract this information.
    Thanks

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Tried checking snapshot job status?

  3. #3
    Join Date
    Mar 2007
    Posts
    27
    thanks for you're feedback,
    the sanpshot job terminates as soon as the sanpshot agent takes the snapshot.
    but I'm interested in the bulk insert on the subscription ( that takes place after th snapshot has been taken)
    need to know when that finishes

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    May query distribution..MSsnapshot_history.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •