Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSenum_distribution_sd

 

A summary of all subscribers across all publictions. Last change made in SP1 to exclude the state in MSlogreader_history table.




Syntax
create procedure sys.sp_MSenum_distribution_sd
(
    @name nvarchar(100),
    @time datetime = NULL
)
as
begin
    set nocount on

    declare @start_time datetime
    declare @time_up datetime
    declare @agent_id int

    
    -- security check
    -- only replmonitor can execute this
    
    if not (is_member(N'db_owner') = 1 or isnull(is_member(N'replmonitor'),0) = 1)
    begin
        raiserror(14260, 16, -1)
        return (1)
    end

    IF @time IS NULL
        select @time = GETDATE()

    select @agent_id = id from MSdistribution_agents where
        name = @name

    /*
    ** Minute-approximate @time can be used.
    ** Note: The select only return datetime data with minute precision
    */
    IF  DATEPART(second, @time) = 0 AND
        DATEPART(millisecond, @time) = 0
    BEGIN
        SELECT @time_up = DATEADD(second, +59, @time)
        SELECT @time_up = DATEADD(millisecond, +999, @time)
    END
    ELSE
        SELECT @time_up = @time


    select top 1 @start_time = start_time
         from MSdistribution_history rh with (READPAST)
        where
        rh.agent_id = @agent_id and
        time <= @time_up
        order by timestamp DESC

    select  runstatus,
        'time' = sys.fn_replformatdatetime(time),
        comments, duration,
        delivery_rate,
        delivery_latency,
        /* delivery_time */ 0,
        delivered_transactions, delivered_commands, average_commands,
        error_id
        from MSdistribution_history rh with (READPAST)
        where
        rh.agent_id = @agent_id and
        start_time = @start_time
        order by timestamp desc
end

 
Last revision SQL2008SP1
See also

  sp_instdist (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