Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Start SnapShot agent in T-SQL


Start SnapShot agent in T-SQL

Author
Message
Jules Bonnot
Jules Bonnot
Old Hand
Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)

Group: General Forum Members
Points: 378 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
Dinakar Nethi-176633
Dinakar Nethi-176633
SSC Veteran
SSC Veteran (273 reputation)SSC Veteran (273 reputation)SSC Veteran (273 reputation)SSC Veteran (273 reputation)SSC Veteran (273 reputation)SSC Veteran (273 reputation)SSC Veteran (273 reputation)SSC Veteran (273 reputation)

Group: General Forum Members
Points: 273 Visits: 188
I am not sure..but you can always run profiler and see whats being called..

******************
Dinakar Nethi
Life is short. Enjoy it.
******************
Pedro R. Lopez
Pedro R. Lopez
SSC-Enthusiastic
SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)

Group: General Forum Members
Points: 162 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/
CJ007
CJ007
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
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.
Abrar Ahmad_
Abrar Ahmad_
SSC Veteran
SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)

Group: General Forum Members
Points: 253 Visits: 1288

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!


Christopher Kutsch
Christopher Kutsch
SSC Rookie
SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)

Group: General Forum Members
Points: 25 Visits: 194
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search