Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_enumfullsubscribers

  No additional text.


Syntax
create procedure sys.sp_MSrepl_enumfullsubscribers
(
	@publication	sysname,
	@publisher		sysname,
	@publisher_type	sysname
)
AS
BEGIN
    /*
    ** Declarations.
    */

    DECLARE @retcode int

    /*
    ** Security Check
    */
    exec @retcode = sys.sp_MSreplcheck_publish
    if @@ERROR <> 0 or @retcode <> 0
        return(1)

    /*
    ** Parameter Check: @publication.
    ** Check to make sure that the publication exists and that it conforms
    ** to the rules for identifiers.
    */

    IF @publication IS NOT NULL
	BEGIN
		IF @publication <> '%'
		BEGIN
			EXECUTE @retcode = sys.sp_validname @publication

			IF @retcode <> 0
				RETURN (1)
		END

		IF NOT EXISTS
		(
			SELECT	*
			FROM	syspublications
			WHERE	((@publication = N'%') or (name = @publication))
			  AND	pubid IN (SELECT * FROM sys.fn_IHgetpubid(@publication, @publisher, @publisher_type))
		)
		BEGIN
			RAISERROR (20026, 11, -1, @publication)
			RETURN (1)
		END
	END
    ELSE
    BEGIN
        RAISERROR (14043, 16, -1, '@publication', 'sp_MSrepl_enumfullsubscribers')
        RETURN (1)
    END

    /*
    ** Select all subscribers who subscribe to all articles in the desired
    ** publication.
    */

    SELECT	DISTINCT 'subscriber' = ss.srvname
	FROM	syspublications p,
			sysextendedarticlesview s,
			syssubscriptions ss
	WHERE	((@publication = N'%') or (p.name = @publication collate database_default))
	AND		p.pubid = s.pubid
	AND		s.artid = ss.artid
	and (ss.srvname is not null and len(ss.srvname)> 0)
	AND		NOT EXISTS
			(
				SELECT	*
				FROM	sysextendedarticlesview s2
				WHERE	s2.pubid = p.pubid
				AND		NOT EXISTS
				(
					SELECT	*
					FROM	syssubscriptions ss2
					WHERE	s2.artid = ss2.artid
					AND		ss2.srvname = ss.srvname
					and (ss2.srvname is not null and len(ss2.srvname)> 0)
			)
			)
END

 
Last revision 2008RTM
See also

  sp_enumfullsubscribers (Procedure)
sp_MSdrop_repltran (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