Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSmap_generation_to_partitionids

  No additional text.


Syntax


create procedure sys.sp_MSmap_generation_to_partitionids @gen bigint, @art_nick int, @is_local_gen bit=0
as
    if exists (select * from dbo.sysmergepublications where use_partition_groups > 0)
    begin
        if @art_nick is null
                select @art_nick = 0

        if @art_nick = 0
        begin
            insert into dbo.MSmerge_generation_partition_mappings with (rowlock)
                (publication_number, partition_id, generation, changecount)
                    select cpm.publication_number, cpm.partition_id, mc.generation, count(*)
                    from dbo.MSmerge_current_partition_mappings cpm with (rowlock)
                        inner join dbo.MSmerge_contents mc with (rowlock) on mc.tablenick = cpm.tablenick
                    and mc.rowguid = cpm.rowguid
                    and mc.generation = @gen
                    group by cpm.publication_number, cpm.partition_id, mc.generation

            insert into dbo.MSmerge_generation_partition_mappings with (rowlock)
                (publication_number, partition_id, generation, changecount)
                    select publication_number, partition_id, generation, count(*)
                    from dbo.MSmerge_past_partition_mappings with (rowlock)
                    where generation = @gen
                    group by publication_number, partition_id, generation
        end
        else
        begin
            insert into dbo.MSmerge_generation_partition_mappings with (rowlock)
                (publication_number, partition_id, generation, changecount)
                    select cpm.publication_number, cpm.partition_id, mc.generation, count(*)
                    from dbo.MSmerge_current_partition_mappings cpm with (rowlock)
                        inner join dbo.MSmerge_contents mc with (rowlock) on mc.tablenick = cpm.tablenick
                    and mc.tablenick = @art_nick
                    and cpm.tablenick = @art_nick
                    and mc.rowguid = cpm.rowguid
                    and mc.generation = @gen
                    group by cpm.publication_number, cpm.partition_id, mc.generation

            insert into dbo.MSmerge_generation_partition_mappings with (rowlock)
                (publication_number, partition_id, generation, changecount)
                    select publication_number, partition_id, generation, count(*)
                    from dbo.MSmerge_past_partition_mappings with (rowlock)
                    where generation = @gen
                    and tablenick = @art_nick
                    group by publication_number, partition_id, generation
        end
    end

    return 0

 
Last revision 2008RTM
See also

  sp_MSclosegeneration (Procedure)
sp_MSdrop_rlrecon (Procedure)
sp_MSlocalizeinterruptedgenerations (Procedure)
sp_MSupdategenhistory (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