Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSdrop_expired_mergesubscription90

  No additional text.


Syntax

create procedure sys.sp_MSdrop_expired_mergesubscription90
AS
begin
	declare @subscriber sysname
	, @subscriber_db sysname
	, @publisher sysname
	, @publisher_db sysname
	, @publication sysname
	, @retcode int
    , @distributor sysname
	, @distribdb sysname
	, @distproc nvarchar(400)
	, @index int
	
	select @publisher = UPPER(publishingservername())
	select @publisher_db = db_name()
	select @index = 0
		
	declare expired_subscriber_info cursor local fast_forward for
	select sms.subscriber_server, sms.db_name, smp.name
	from dbo.sysmergesubscriptions sms join dbo.sysmergepublications smp
	on sms.pubid = smp.pubid
	and sys.fn_MSmerge_islocalpubid(smp.pubid) = 1
	and sms.replica_version >= 90
	and sms.cleanedup_unsent_changes = 1
	and sms.pubid <> sms.subid
	for read only
	
	open expired_subscriber_info
	
	fetch next from expired_subscriber_info into @subscriber, @subscriber_db, @publication
	
	while @@fetch_status <> -1
	begin
		
		-- get distributor info only once, the very first time once we know at least one sub has expired.
		if @index = 0
		begin
		
			-- Get distribution server information for remote RPC call.
			EXEC @retcode = sys.sp_MSrepl_getdistributorinfo @publisher      = @publisher,
    														@rpcsrvname     = @distributor OUTPUT,
    														@distribdb      = @distribdb OUTPUT
		    												
			if @@error <> 0 or @retcode <> 0
				return 1
			
			SELECT @distproc = QUOTENAME(RTRIM(@distributor)) + '.' + QUOTENAME(RTRIM(@distribdb)) + '..sp_MScleanup_subscription_distside_entry'
			
			select @index = @index + 1
		end
	
	    EXEC @retcode = @distproc @publisher = @publisher,
									@publisher_db = @publisher_db,
									@publication = @publication,
									@subscriber = @subscriber,
									@subscriber_db = @subscriber_db
		if @@error <> 0 or @retcode <> 0
			goto FAILURE
									
	
	fetch next from expired_subscriber_info into @subscriber, @subscriber_db, @publication
	end
	
	close expired_subscriber_info
	deallocate expired_subscriber_info
	
	return 0
	
FAILURE:

	close expired_subscriber_info
	deallocate expired_subscriber_info
	
	return 1
end

 
Last revision 2008RTM
See also

  sp_MSdrop_expired_mergesubscription (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