Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSsubsetpublication

  No additional text.


Syntax

create procedure sys.sp_MSsubsetpublication (@publication sysname)
as
	declare @pubid			uniqueidentifier
	declare @boolean_filter bit
	declare @join_filter	bit
	declare @full			int
	declare @subset			int

	select @full		= 0		/* Const: publication type 'full' */
	select @subset		= 1		/* Const: publication type 'subset' */
	
	if object_id('sysmergepublications') is NULL
	BEGIN
		RAISERROR (20054, 16, -1)
		RETURN (1)
	END

	select @pubid = pubid from dbo.sysmergepublications where
		name = @publication and UPPER(publisher)=UPPER(publishingservername()) and publisher_db=db_name()
	if @pubid is null
	BEGIN
		RAISERROR (20026, 16, -1, @publication)
		RETURN (1)
	END

	/*
	** Set the publication_type to subset if the publication has either a boolean or a join filter
	*/
	if exists (select * from dbo.sysmergearticles where pubid = @pubid and len(subset_filterclause) > 0)
		set @boolean_filter = 1
	if exists (select * from dbo.sysmergesubsetfilters where pubid = @pubid and (filter_type & 1) = 1)
		set @join_filter = 1

	/*
	** For subset publications set the article status to be unsynced so that the triggers can be regenerated.
	*/
	if (@boolean_filter = 1 OR @join_filter = 1)		
	begin
		update dbo.sysmergepublications set publication_type = @subset where pubid = @pubid
		if @@ERROR <> 0 return (1)

        -- For both new and existing articles, set status back to their respective
        -- "unsynched"-status.
        update dbo.sysmergearticles set status = status-1
            where pubid = @pubid and status in (2,6)
        if @@ERROR <> 0 return (1)
	end			
	else
	begin
		update dbo.sysmergepublications set publication_type = @full where pubid = @pubid				
	    if @@ERROR <> 0 return (1)
	end
		
	return(0)			

 
Last revision 2008RTM
See also

  sp_addmergefilter (Procedure)
sp_changemergearticle (Procedure)
sp_changemergefilter (Procedure)
sp_dropmergearticle (Procedure)
sp_dropmergefilter (Procedure)
sp_helpmergesubscription (Procedure)
sp_MSdrop_rladmin (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