Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSsetgentozero

  No additional text.


Syntax
create procedure sys.sp_MSsetgentozero
        (@tablenick int,
         @rowguid uniqueidentifier,
         @metatype tinyint= null)
as
    declare @retcode int
    declare @METADATA_TYPE_Tombstone tinyint
    declare @METADATA_TYPE_Contents tinyint
    declare @METADATA_TYPE_PartialDelete tinyint
    declare @METADATA_TYPE_SystemDelete tinyint

    set @METADATA_TYPE_Tombstone= 1
    set @METADATA_TYPE_Contents= 2
    set @METADATA_TYPE_PartialDelete= 5
    set @METADATA_TYPE_SystemDelete= 6

    if (@rowguid is null)
    begin
        RAISERROR(14043, 16, -1, '@rowguid', 'sp_MSsetgentozero')
        return (1)
    end
    if (@tablenick is null)
    begin
        RAISERROR(14043, 16, -1, '@tablenick', 'sp_MSsetgentozero')
        return (1)
    end
    if (@metatype is not null and
        @metatype not in (@METADATA_TYPE_Tombstone,
                          @METADATA_TYPE_Contents,
                          @METADATA_TYPE_PartialDelete,
                          @METADATA_TYPE_SystemDelete))
    begin
        --RAISERROR(20052, 16, -1)
        return 0
    end

    -- security check
    exec @retcode = sys.sp_MSrepl_PAL_rolecheck @tablenick = @tablenick
    if (@retcode <> 0) or (@@error <> 0)
        return 1

    if @metatype in (@METADATA_TYPE_Tombstone,
                     @METADATA_TYPE_PartialDelete,
                     @METADATA_TYPE_SystemDelete)
    begin
                update dbo.MSmerge_tombstone
                        set generation = 0
                        where tablenick = @tablenick and rowguid = @rowguid
    end
    else if @metatype = @METADATA_TYPE_Contents
    begin
                update dbo.MSmerge_contents
                        set generation = 0
                        where tablenick = @tablenick and rowguid = @rowguid

                update dbo.MSmerge_past_partition_mappings
                        set generation = 0
                        where tablenick = @tablenick and rowguid = @rowguid
    end
    else
    begin
                update dbo.MSmerge_tombstone
                        set generation = 0
                        where tablenick = @tablenick and rowguid = @rowguid

                if 0 = @@rowcount
                begin
                        update dbo.MSmerge_contents
                                set generation = 0
                                where tablenick = @tablenick and rowguid = @rowguid
                end

        update dbo.MSmerge_past_partition_mappings
            set generation = 0
            where tablenick = @tablenick and rowguid = @rowguid
    end

    return 0

 
Last revision 2008RTM
See also

  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