Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_get_job_status_mergesubscription_agent

  No additional text.


Syntax
create procedure sys.sp_get_job_status_mergesubscription_agent
(
    @publisher      sysname = NULL,
    @publisher_db   sysname = NULL,
    @publication    sysname = NULL,
	@agent_name nvarchar(100) = NULL
)
as
begin	
	set nocount on
	declare @retcode  int
	declare @isdistdb bit	
	declare @runstatus int
	
	select @isdistdb = sys.fn_MSrepl_isdistdb(DB_NAME())

	
    -- security check
    
	if (@isdistdb = 1)
	begin
		if not (is_member(N'db_owner') = 1 or isnull(is_member(N'replmonitor'),0) = 1)
		begin
			raiserror(14260, 16, -1)
			return (1)
		end
	end
	else
	begin
		if not (is_member(N'db_owner') = 1)
		begin
			raiserror(14260, 16, -1)
			return (1)
		end
	end


	
	
    if @isdistdb = 1 and @agent_name is null
    begin
		raiserror(14043, 16, -1, '@agent_name', 'sp_get_job_status_mergesubscription_agent')
		return 1
	end
	else if @isdistdb = 0 and (@publisher is null or @publisher_db is null or @publication is null)
    begin
		-- subscriber-side monitoring
		if @publisher is null
			raiserror(14043, 16, -1, '@publisher', 'sp_get_job_status_mergesubscription_agent')
		if @publisher_db is null
			raiserror(14043, 16, -1, '@publisher_db', 'sp_get_job_status_mergesubscription_agent')
		if @publication is null
			raiserror(14043, 16, -1, '@publication', 'sp_get_job_status_mergesubscription_agent')
		return 1
	end	

	if(@isdistdb = 1)
	begin
		exec @retcode = sp_get_job_status_mergepushsubscription_agent @agent_name,@runstatus=@runstatus output
	end	
	else
	begin
		exec @retcode = sp_get_job_status_mergepullsubscription_agent
					   @publisher=@publisher,
					   @publisher_db=@publisher_db,
					   @publication=@publication,
					   @runstatus=@runstatus output
	end

	select @runstatus

	return @retcode
end

 
Last revision 2008RTM
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