Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helpmergedeleteconflictrows

  No additional text.


Syntax

create procedure sys.sp_helpmergedeleteconflictrows(
	@publication	sysname = '%',
	@source_object	nvarchar(386) = NULL,
	@publisher		sysname = NULL,
	@publisher_db	sysname = NULL,
	@logical_record_conflicts int = 0
	)
as
	declare @pubid			uniqueidentifier
	declare @cmd			nvarchar(4000)	
	declare @pubidstr		nvarchar(38)
	declare @retcode		int

	-- Security check: dbo and sysadmin only
	exec @retcode = sys.sp_MSreplcheck_publish
	if @@error <> 0 or @retcode <> 0
	begin
		return 1
	end	

	if @publisher IS NULL
		select @publisher = publishingservername()
		
	if @publisher_db IS NULL
		select @publisher_db = db_name()
	select @cmd = 'select distinct source_object = schema_name(sys.objects.schema_id) + '
	select @cmd = @cmd + '''.'''
	select @cmd = @cmd + ' + sys.objects.name, MSmerge_conflicts_info.rowguid, MSmerge_conflicts_info.conflict_type, '
	select @cmd = @cmd + ' MSmerge_conflicts_info.reason_code, MSmerge_conflicts_info.reason_text, '
	select @cmd = @cmd + ' MSmerge_conflicts_info.origin_datasource, MSmerge_conflicts_info.pubid, MSmerge_conflicts_info.MSrepl_create_time from MSmerge_conflicts_info, dbo.sysmergearticles, sys.objects'	
	select @cmd = @cmd + ' where dbo.sysmergearticles.nickname = MSmerge_conflicts_info.tablenick
					 and sys.objects.object_id = dbo.sysmergearticles.objid '

    -- Do not return logical record conflicts unless requested.
	if @logical_record_conflicts = 0
	begin
        select @cmd = @cmd + ' and MSmerge_conflicts_info.conflict_type in (4, 7, 8) '
	end
	else
	begin
        select @cmd = @cmd + ' and MSmerge_conflicts_info.conflict_type in (4, 7, 8, 12) '
	end
	
	if @publication <> '%'
		begin
			/*
			** Parameter Check:	 @publication.
			** Make sure that the publication exists.
			*/
			select @pubid = pubid from dbo.sysmergepublications
				where name = @publication and
					LOWER(publisher) = LOWER(@publisher) and
					publisher_db = @publisher_db
			if @pubid IS NULL
				BEGIN
					RAISERROR (20026, 16, -1, @publication)
					RETURN (1)
				END
			set @pubidstr = '''' + convert(nchar(36), @pubid) + ''''
			select @cmd = @cmd + ' and MSmerge_conflicts_info.pubid = ' + @pubidstr
		end

	if @source_object IS NOT NULL
		begin
			declare @object			sysname	
			declare @owner			sysname	
			declare @tablenick		int
			declare @tablenickstr	nvarchar(11)
			
			select @object = PARSENAME(@source_object, 1)
			select @owner = PARSENAME(@source_object, 2)
			execute sys.sp_MStablenickname @owner, @object, @tablenick output
			if @tablenick IS NULL
				BEGIN
					raiserror (20003, 11, -1, @object)
					RETURN (1)
				END
			set @tablenickstr = convert(nchar, @tablenick)
			select @cmd = @cmd + ' and MSmerge_conflicts_info.tablenick = '
			select @cmd = @cmd + @tablenickstr
		end

	exec (@cmd)
	if (@@error <> 0)
		RETURN (1)
	
	return 0

 
Last revision 2008RTM
See also

  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