Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSmergeagentjobcontrol

  No additional text.


Syntax
create procedure sys.sp_MSmergeagentjobcontrol
(
    @publisher      sysname,
    @publisher_db   sysname,
    @publication    sysname,
    @subscriber     sysname,
    @subscriber_db  sysname,
    @action         tinyint
)
as
begin
    set nocount on

    declare @job_id         uniqueidentifier
    declare @publisher_id   int
    declare @subscriber_id  int
    declare @retcode        int
    set @retcode = 0

    set @publisher_id = null
    select @publisher_id = server_id
      from sys.servers
     where upper(name) = upper(@publisher) collate database_default
    if @publisher_id is null
    begin
        raiserror (21618, 16, -1, @publisher)
        return 1
    end

    set @job_id = null
    select @job_id = msma.job_id
      from dbo.MSmerge_agents as msma
inner join msdb.dbo.sysjobs_view as sjv
        on msma.job_id = sjv.job_id
inner join msdb.dbo.sysjobsteps as sjs
        on sjv.job_id = sjs.job_id
     where msma.publisher_id = @publisher_id
       and msma.publisher_db = @publisher_db
       and msma.publication = @publication
       and upper(msma.subscriber_name) = upper(@subscriber)
       and msma.subscriber_db = @subscriber_db
       and sjv.category_id = 14
       and sjs.subsystem = N'Merge'

    if @job_id is null
    begin
        -- "Could not find a merge agent job for the specified merge push subscription."
        raiserror(21847, 16, -1)
        return 1
    end
    exec @retcode = sys.sp_MSreplicationagentjobcontrol
        @job_id = @job_id,
        @action = @action
    return @retcode

end

 
Last revision 2008RTM
See also

  sp_MSstartmerge_agent (Procedure)
sp_MSstopmerge_agent (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash