Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_get_job_status_mergepushsubscription_agent

  No additional text.


Syntax
create procedure sys.sp_get_job_status_mergepushsubscription_agent
(
	@agent_name nvarchar(100),
    @runstatus         int output
)
as
begin
    set nocount on
    declare @retcode            int
    declare @job_id             uniqueidentifier
	declare @step_uid           uniqueidentifier

	select @runstatus  = NULL

    select @job_id = sjs.job_id,
	       @step_uid = sjs.step_uid
          from MSmerge_agents ma
    inner join msdb.dbo.sysjobsteps sjs
            on ma.job_step_uid = sjs.step_uid
    inner join msdb.dbo.sysjobs_view sjv
            on sjv.job_id = sjs.job_id
           where ma.name=	@agent_name
           and sjv.master_server = 0
           and sjv.category_id = 14
           and sjs.subsystem = N'Merge'
           and (sjs.database_name is null or sjs.database_name = db_name())


    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

	-- this table  holds  only single row
    declare @job_info table(
		 runstatus 	int,
		 message 		nvarchar(1024),
		 date 			int,		
		 time 			int,		
		 datetime		nvarchar(50)		 	
		)
		

	insert into @job_info exec sp_MSenum_replication_job @job_id=@job_id,@step_uid=@step_uid
	select top 1 @runstatus=runstatus from @job_info

end

 
Last revision 2008RTM
See also

  sp_get_job_status_mergesubscription_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