Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSget_min_seqno

  No additional text.


Syntax
CREATE PROCEDURE sys.sp_MSget_min_seqno
(
    @agent_id int,
    @xact_seqno varbinary(16) OUTPUT
)
as
BEGIN
    declare @publisher_db_id int,
		@publisher sysname,
		@publisher_dbname sysname,
		@publication_id int,
		@dbversion int,
		@publication sysname,
        @retcode int,
        @IsP2PAgent bit,
        @nosync_type tinyint

    
    -- Security Check
    
    if @agent_id is not null
    begin
        exec @retcode = sys.sp_MScheck_pull_access
            @agent_id = @agent_id,
            @agent_type = 0 -- distribution agent
        if @@error <> 0 or @retcode <> 0
            return (1)
    end
    else
    begin
        return (1)
    end

    --exec sys.sp_MSispeertopeeragent @agent_id = @agent_id, @is_p2p = @IsP2PAgent output

    --if @@error <> 0 or @IsP2PAgent <> 0
    --begin
    --    return (1)
    --end

   select @publisher_db_id = publisher_database_id
   from MSdistribution_agents
   where id = @agent_id

    if @publisher_db_id is null
        return (1)

   --MSsubscriptions has a clustered unique key (agent_id, article_id). For one agent_id, there may
   --be multiple article_id. However, all rows with the same @agent_id should have a same value on nosync_type
   select @nosync_type = nosync_type
   from MSsubscriptions
   where agent_id = @agent_id

    if @nosync_type != 3
    begin
        -- In the case where we have a different nosync type, this tells
        --  the distribution agent that can begin replication.
        -- This should be removed in the future.
        select @xact_seqno = 0x00000000000000000001
        return (0)
    end

    select top 1 @xact_seqno = xact_seqno
        from MSrepl_transactions msrt
            where msrt.publisher_database_id=@publisher_db_id
            order by xact_seqno asc

    return(0)
END


-- Name: sp_MSget_repl_commands

-- Descriptions: Note: sp_MSget_repl_commands and sp_MSget_repl_count have very similar
--  queries. Any changes to one of them should be applied to all others.

-- Parameters: as defined in create statement

-- Returns: 0 - success
--          1 - Otherwise

-- BUGBUG: If resource db support does not improve - this SP should be moved back
-- to instdist.sql for supportability. It accesses system catalogs

-- Security: Public procedure invoked via RPC. PAL check
-- Requires Certificate signature for catalog access

raiserror(15339,-1,-1,'sp_MSget_repl_commands')

 
Last revision 2008RTM
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