Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Start SnapShot agent in T-SQL Expand / Collapse
Author
Message
Posted Tuesday, July 11, 2006 7:23 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, September 26, 2014 11:40 AM
Points: 374, Visits: 409

SQL2005

 

I need to automate the starting of the snapshot agent.  At the moment i have to go into replication monitor right click on snapshot agent and click start.

Is this possible in T-SQL or do you have to use the DOS cmd. Any sample code would be nice,

Thanks,

Jules



www.sql-library.com
Post #293452
Posted Wednesday, July 12, 2006 11:59 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, June 16, 2015 2:44 PM
Points: 265, Visits: 184
I am not sure..but you can always run profiler and see whats being called..

******************
Dinakar Nethi
Life is short. Enjoy it.
******************
Post #293861
Posted Wednesday, July 12, 2006 1:45 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, February 4, 2009 1:49 PM
Points: 160, Visits: 140

Every time the you create a publication a jobs is created in sql server with this name

[SERVER_NAME]-[DATABASE_NAME]-publ_[PUBL_NAME]

don't you have it on you job list ?

there is an step inside the job that look like this

 

-Publisher [SQL05] -PublisherDB [db_1] -Distributor [SQL05] -Publication [publ_db_1] -ReplicationType 2 -DistributorSecurityMode 1



Pedro R. Lopez
http://madurosfritos.blogspot.com/
Post #293903
Posted Saturday, December 10, 2011 11:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 29, 2012 3:11 AM
Points: 3, Visits: 29
In Sql Server 2005, you can use the sp_startpublication_snapshot stored procedure to achieve this, using the following format:

sp_startpublication_snapshot [ @publication = ] 'publication'
[ , [ @publisher = ] 'publisher' ]

(omit the publisher out if you are using a SQL Server publisher).

I do not know if this is appropriate to Sql Server 7 or 2000 though.
Post #1219842
Posted Wednesday, April 2, 2014 10:33 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 7:33 AM
Points: 215, Visits: 1,155

What about to call for distribution agent in Push Down subscription (snapshot replication) - which job to execute?

and the syntax listed in Job is not of Tsql SP? So how to manage both .. if we can call with the help of SP and with the help of Job syntax?

Thank you!

Post #1557595
Posted Tuesday, July 14, 2015 12:46 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, July 24, 2015 9:14 AM
Points: 25, Visits: 168
Internally, SQL Server matches the snapshot agents to SQL Jobs. You can access this information from the distribution database:

    select *
from dbo.MSsnapshot_agents as mssa
inner join msdb.dbo.sysjobs_view as sjv
on mssa.job_id = sjv.job_id
inner join msdb.dbo.sysjobsteps as sjs
on sjv.job_id = sjs.job_id
where sjv.category_id = 15
and sjs.subsystem = N'Snapshot'
and mssa.dynamic_filter_login is NULL
and mssa.dynamic_filter_hostname is NULL

Post #1702797
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse