Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_helpsubscriberinfo

  No additional text.


Syntax
create procedure sys.sp_MSrepl_helpsubscriberinfo
(
	@subscriber sysname = '%',
	@publisher	sysname,
	@found		bit = NULL OUTPUT
)
AS
BEGIN
    SET NOCOUNT ON

    DECLARE @distributor sysname
    DECLARE @distribdb sysname
    DECLARE @distproc nvarchar (300)
    DECLARE @retcode int
    DECLARE @subscriber_bit smallint
    DECLARE @show_password bit

    /*
    ** Security Check. Restrict to 'sysadmin', DBO of publishing database, PAL
    */
    IF is_member(N'db_owner') <> 1
    BEGIN
        EXEC @retcode = sys.sp_MSreplcheck_pull @publisher   = @publisher

        IF @retcode <> 0 OR @@ERROR <> 0
        BEGIN
            RETURN (1)
        END
    END

    /*
    ** Initializations.
    */
    SELECT @subscriber_bit = 4


    /*
    ** Check if subscriber is valid
    */

    IF @subscriber IS NULL
	BEGIN
		RAISERROR (14043, 16, -1, '@subscriber', 'sp_MSrepl_helpsubscriberinfo')
		RETURN (1)
	END

	/*
    ** Get distribution server information for remote RPC
    ** subscription calls.
    */

    EXEC @retcode = sys.sp_MSrepl_getdistributorinfo	@publisher	= @publisher,
														@rpcsrvname	= @distributor OUTPUT,
														@distribdb	= @distribdb OUTPUT

    /* RAISEERROR is subscriber is not '%' */
    IF @@error <> 0 OR @retcode <> 0 OR @distribdb IS NULL OR @distributor IS NULL
	BEGIN
		IF @subscriber <> '%'
		BEGIN
			RAISERROR (14071, 16, -1)
			RETURN (1)
		END
		ELSE
		BEGIN
			RETURN 0
		END
	END

     create table #subscriber_info
     (
        publisher						sysname collate database_default not null,
        subscriber						sysname collate database_default not null,
        type							tinyint not null,           /* 0: MS SQL Server 1: ODBC Data Source */
        login							sysname collate database_default null,
        password						nvarchar(524) NULL,
        commit_batch_size				int not null,  -- commit_batch_size, no longer supported
        status_batch_size				int not null,  -- status_batch_size, no longer supported
        flush_frequency					int not null,  -- flush_frequency, no longer supported
        frequency_type					int not null,
        frequency_interval				int not null,
        frequency_relative_interval 	int not null,
        frequency_recurrence_factor 	int not null,
        frequency_subday				int not null,
        frequency_subday_interval		int not null,
        active_start_time_of_day		int not null,
        active_end_time_of_day			int not null,
        active_start_date				int not null,
        active_end_date					int not null,
        retryattempt					int not null, -- retryattempt, no longer exist
        retrydelay						int not null, -- retrydelay, no longer exist
        description						nvarchar(255) collate database_default null,
        security_mode					int not null,
        frequency_type2					int not null,
        frequency_interval2				int not null,
        frequency_relative_interval2	int not null,
        frequency_recurrence_factor2	int not null,
        frequency_subday2				int not null,
        frequency_subday_interval2		int not null,
        active_start_time_of_day2		int not null,
        active_end_time_of_day2			int not null,
        active_start_date2				int not null,
        active_end_date2				int not null
    )

    IF @@error <> 0
        RETURN (1)

    /*
    ** Retrieve MSsubscriber_info
    */
    if is_srvrolemember('sysadmin') = 1
        select @show_password = 1
    else
        select @show_password = 0

    SELECT @distproc =	QUOTENAME(RTRIM(@distributor)) + '.' +
						QUOTENAME(RTRIM(@distribdb)) + '.dbo.sp_MShelp_subscriber_info'

    insert into #subscriber_info
    EXEC @retcode =	@distproc	@publisher		= @publisher,
								@subscriber		= @subscriber,
								@show_password	= @show_password

    IF @@error <> 0
        BEGIN
        RAISERROR (14071, 16, -1)
     RETURN (1)
    END

    IF @retcode <> 0
        BEGIN
        RAISERROR (14085, 16, -1)
        RETURN (1)
     END
	
	-- Filter out subscribers that are not defined locally but left at the distributor
	-- This will happen if the publisher is cleaned up when the distributor is offline.
	DELETE FROM	#subscriber_info
	WHERE	UPPER(subscriber collate database_default) IN
			(
				SELECT	UPPER(servers.srvname COLLATE database_default)
				FROM	master.dbo.sysservers servers
				WHERE	(servers.srvstatus & @subscriber_bit) = 0
			)

	-- Set found bit if requested
	IF @found IS NOT NULL
	BEGIN
		SELECT	@found = COUNT(*)
		FROM	#subscriber_info
	END
	ELSE
	BEGIN
		SELECT	*
		FROM	#subscriber_info
	END
END

 
Last revision 2008RTM
See also

  sp_dropdistpublisher (Procedure)
sp_helpsubscriberinfo (Procedure)
sp_MSdrop_replcom (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