﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Trigger distribution job on completion of snapshot job / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 14:29:33 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>do have your servers running on different id's?.if it is same id why access change is required?</description><pubDate>Tue, 04 Sep 2012 04:44:43 GMT</pubDate><dc:creator>durai nagarajan</dc:creator></item><item><title>RE: Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>I see, in that case I have to provide access to MSDB, while creating Linked server.But thanks for your suggestion, that should work as far as I see.Thanks Man</description><pubDate>Tue, 04 Sep 2012 01:30:17 GMT</pubDate><dc:creator>asir83</dc:creator></item><item><title>RE: Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>[quote][b]asir83 (9/4/2012)[/b][hr]Hey,I have one more question, what if the subscriber is a pull subscription &amp; the job is created on different instance?How can we call the subscriber job remotely?Thanks Asir[/quote]I think above said stored procedure can be executed via a linked server also. Link servers are not very good when it comes to performance but in this particular case they may be useful.</description><pubDate>Tue, 04 Sep 2012 01:17:00 GMT</pubDate><dc:creator>Divine Flame</dc:creator></item><item><title>RE: Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>Hey,I have one more question, what if the subscriber is a pull subscription &amp; the job is created on different instance?How can we call the subscriber job remotely?Thanks Asir</description><pubDate>Tue, 04 Sep 2012 00:58:10 GMT</pubDate><dc:creator>asir83</dc:creator></item><item><title>RE: Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>U da Man...... :) Bet this is what I was looking for, let me try this...Thanks a lot Buddy, apprecaite ur prompt reply.</description><pubDate>Mon, 03 Sep 2012 05:16:32 GMT</pubDate><dc:creator>asir83</dc:creator></item><item><title>RE: Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>[quote][b]asir83 (9/3/2012)[/b][hr]Since 30-Aug, the snapshot agent is running for more than 15mins, the interval between the snapshot &amp; subscriber job is 15mins, time increase could possibly due to increase in data, I saw the snapshot size was near to 7 gigs which usually remained between 5-6 gigs on an average.Since the Snapshot job didn't complete before the subscriber job started, it didn't find a complete snapshot &amp; failed to replicate the data &amp; became inactive.I can very well increase the time between both the jobs, but that will just be a temp workaround.I wanted to check how can this situation be handled. Can a triggers be set that can trigger the distribution job as soon as the snapshot jobs completes.Apprently, i don't have any working knowledge with triggers, apprecaite if you could provide me with a script or something that I can use to make the Distribution job dependent on Snapshot.This has become a pain for me, please give me a permanent solution.Thanks Asir[/quote]You can use system stored procedure sp_start_job to start the subscriber job after the snapshot agent has completed. It can be done as :1. Add a new step of type "Transact-SQL Script" in the Snapshot Agent Job2. This new step should be the last step to execute after all previous steps have successfully executed3. Write below command in this step:[code="sql"]EXECUTE msdb.dbo.sp_start_job @job_name='PutSubscriberJobNameHere'[/code]Once this has been configured you can disable the schedule of the subscriber job so that it only runs after snapshot job has completed.</description><pubDate>Mon, 03 Sep 2012 04:01:18 GMT</pubDate><dc:creator>Divine Flame</dc:creator></item><item><title>Trigger distribution job on completion of snapshot job</title><link>http://www.sqlservercentral.com/Forums/Topic1353406-146-1.aspx</link><description>Since 30-Aug, the snapshot agent is running for more than 15mins, the interval between the snapshot &amp; subscriber job is 15mins, time increase could possibly due to increase in data, I saw the snapshot size was near to 7 gigs which usually remained between 5-6 gigs on an average.Since the Snapshot job didn't complete before the subscriber job started, it didn't find a complete snapshot &amp; failed to replicate the data &amp; became inactive.I can very well increase the time between both the jobs, but that will just be a temp workaround.I wanted to check how can this situation be handled. Can a triggers be set that can trigger the distribution job as soon as the snapshot jobs completes.Apprently, i don't have any working knowledge with triggers, apprecaite if you could provide me with a script or something that I can use to make the Distribution job dependent on Snapshot.This has become a pain for me, please give me a permanent solution.Thanks Asir</description><pubDate>Mon, 03 Sep 2012 03:19:20 GMT</pubDate><dc:creator>asir83</dc:creator></item></channel></rss>