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,
Every time the you create a publication a jobs is created in sql server with this 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
select * from dbo.MSsnapshot_agents as mssainner join msdb.dbo.sysjobs_view as sjv on mssa.job_id = sjv.job_idinner 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