Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_IHreplincrementlsn

  No additional text.


Syntax


-- Name:
--          sp_IHreplincrementlsn

-- Description:
--          HREPL: Request publisher lsn for heterogeneous publications

-- Security:
--          internal -- call must be sysadmin or dboin distribution db
-- Requires Certificate signature for catalog access

-- Returns:
--          Success/failure

-- Notes:
--          This procedure is used when administering heterogeneous publications, to request the last committed
--          transaction sequence number for the publisher.  If there are no entries for the publisher in
--          MSrepl_transactions, 0x00000000000000000000 is returned.

--          Must be run from distribution database for publisher.

-- Owner:
--          

create procedure sys.sp_IHreplincrementlsn
(
    @xact_seqno binary(10) OUTPUT,
    @publisher sysname
)
AS
BEGIN
    declare
        @retcode int,
        @publisher_id int,
        @publisher_db sysname

    
    -- Security Check: require sysadmin or dbo in distribution db
    
    exec @retcode = sys.sp_MSreplcheck_publish
    if @@ERROR <> 0 or @retcode <> 0
    begin
       	return(1)
    end

    SELECT @publisher_id = s.srvid,
        @publisher_db = m.distribution_db
    FROM master.dbo.sysservers s, msdb..MSdistpublishers m
    WHERE UPPER(s.srvname collate database_default) = UPPER(m.name collate database_default)
    AND UPPER(s.srvname collate database_default) = UPPER(@publisher) collate database_default
    AND m.distribution_db = DB_NAME() collate database_default
	
    IF @@ERROR <> 0
        RETURN (1)

    IF @publisher_id is NULL or @publisher_db IS NULL
    BEGIN
        RETURN (1)
    END

    -- For heterogeneous publishers, the last committed transaction in the
    -- distribution database is used as the timestamp
    EXEC @retcode = sys.sp_MSget_last_transaction
        @publisher_id = @publisher_id,
        @publisher_db = @publisher_db,
        @publisher = @publisher,
        @max_xact_seqno = @xact_seqno OUTPUT

    IF @@ERROR <> 0 or @retcode <> 0
        return(1)

    -- If no transactions have been processed for the heterogeneous publisher, initialize to 0.
    IF @xact_seqno IS NULL
    BEGIN
        set @xact_seqno = 0x00000000000000000000
    END

    return(0)
END

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_replincrementlsn (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