Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MScheckmetadatamatch

  No additional text.


Syntax

create procedure sys.sp_MScheckmetadatamatch
    (@metatype tinyint,
     @rowguid uniqueidentifier,
     @tablenick int,
     @lineage varbinary(311),
     @match int output,
     @compatlevel int = 10,     -- backward compatibility level, default=Sphinx
     @lineage_new varbinary(311) = NULL,
     @new_type_contents bit = NULL)
as
    if @compatlevel < 90
        set @lineage= {fn LINEAGE_80_TO_90(@lineage)}

    if (@metatype = 3 or @metatype = 5 or @metatype = 6)
    begin
        if not exists (select * from dbo.MSmerge_contents where tablenick = @tablenick and rowguid = @rowguid)
            select @match = 1
        else
            select @match = count(*) from dbo.MSmerge_contents with (updlock) where
                tablenick = @tablenick and rowguid = @rowguid and lineage = @lineage
    end
    else
        select @match = count(*) from dbo.MSmerge_contents with (updlock) where
                tablenick = @tablenick and rowguid = @rowguid and lineage = @lineage

    -- In the rare case when the row has been changed behind our back, make sure the new change is not the
    -- same one we are trying to make right now.
    if @match = 0 and @lineage_new is not null and @new_type_contents is not null
    begin
        if @compatlevel < 90
            set @lineage_new= {fn LINEAGE_80_TO_90(@lineage_new)}

        if @new_type_contents = 1
        begin
            if exists (select * from dbo.MSmerge_contents
                            where tablenick = @tablenick
                            and rowguid = @rowguid
                            and lineage = @lineage_new)
                        select @match = -1              -- the desired change has already been made. The calling upd/del proc
                                                                        -- should return without indicating an error which would unnecessarily
                                                                        -- add the row to the retry list. In this case, retry is not needed
                                                                        -- since the result of retry would be a no-op anyway.
        end
        else
        begin
                if exists (select * from dbo.MSmerge_tombstone
                                        where tablenick = @tablenick
                                        and rowguid = @rowguid
                                        and lineage = @lineage_new)
                        select @match = -1              -- the desired change has already been made. The calling upd/del proc
                                                                        -- should return without indicating an error which would unnecessarily
                                                                        -- add the row to the retry list. In this case, retry is not needed
                                                                        -- since the result of retry would be a no-op anyway.
        end
    end

    return (0)

 
Last revision 2008RTM
See also

  sp_MSdelrow (Procedure)
sp_MSdelsubrows (Procedure)
sp_MSdelsubrowsbatch (Procedure)
sp_MSdrop_rlrecon (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