Home Microsoft SQL Server DigiMailing iRN Contact


  No additional text.

-- this proc returns the max generation to bcp out. This essentially same
-- as finding a possible watermark generation. The generation is the max
-- closed generation lower than the min open generation.
-- this proc is called by snapshot to determine till how much it should bcp
create procedure sys.sp_MSgetmaxbcpgen
    @max_closed_gen bigint output
    declare @retcode int

    exec @retcode = sys.sp_MSreplcheck_publish
    if @@error <> 0 or @retcode <> 0
        return 1

    select @max_closed_gen = max(g.generation)
        from MSmerge_genhistory g,
        (select isnull(gen2.generation, gen1.generation) as generation
            from (select max(generation) as generation from dbo.MSmerge_genhistory where genstatus in (1,2)) as gen1,
                 (select min(generation) as generation from dbo.MSmerge_genhistory where genstatus in (0,4)) as gen2
        ) as minopengen
    where g.generation <= minopengen.generation and g.genstatus in (1,2)

    if @max_closed_gen is NULL
        select @max_closed_gen = 0

Last revision 2008RTM
See also

  sp_MSdrop_rlrecon (Procedure)


  Query a named instance
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
Zoekmachine optimalisatie
SQL Servers hidden objects
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
sIFR; de combinatie tussen HTML en Flash