Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSgetagentoffloadinfo

  No additional text.


Syntax
CREATE PROCEDURE sys.sp_MSgetagentoffloadinfo
(
    @job_id     VARBINARY(16)
)
AS
begin
    SET NOCOUNT ON
    DECLARE @agenttype NVARCHAR(20)
    DECLARE @offload_enabled bit
    DECLARE @offload_server  sysname
    DECLARE @agent_table     sysname  -- For use in error message
    DECLARE @independent_agent bit

    
    -- security check
    -- only db_owner can execute this
    
    if (is_member ('db_owner') != 1)
    begin
        raiserror(14260, 16, -1)
        return (1)
    end

    SELECT @agenttype = NULL
    SELECT @agent_table = RTRIM(@@SERVERNAME) + N'.dbo.'
    SELECT @independent_agent = 0

    SELECT @agenttype = LOWER(subsystem collate SQL_Latin1_General_CP1_CS_AS)
      FROM msdb.dbo.sysjobsteps
     WHERE job_id = @job_id
       AND LOWER(subsystem collate SQL_Latin1_General_CP1_CS_AS) IN (N'distribution', N'merge')

    IF @agenttype IS NULL
    BEGIN
        RAISERROR(21134, 16, -1)
        RETURN 1
    END

    IF @agenttype = N'distribution'
    BEGIN
        SELECT @offload_enabled = offload_enabled,
               @offload_server = offload_server
          FROM dbo.MSdistribution_agents da
    INNER JOIN dbo.MSsubscriptions s
            ON da.id = s.agent_id
         WHERE job_id = @job_id
        SELECT @agent_table = @agent_table + N'MSdistribution_agents'
    END
    ELSE
    BEGIN
        SELECT @offload_enabled = offload_enabled,
               @offload_server = offload_server
          FROM dbo.MSmerge_agents
         WHERE job_id = @job_id
        SELECT @agent_table = @agent_table + N'MSmerge_agents'
    END

    IF @@ROWCOUNT = 0
    BEGIN
        RAISERROR(21135, 16, -1, @agent_table)
        RETURN 1
    END

    IF @agenttype = N'distribution'
    BEGIN
        SELECT 'offload_enabled' = @offload_enabled,
               'offload_server' = @offload_server,
               'independent_agent' = @independent_agent
    END
    ELSE
    BEGIN
        SELECT 'offload_enabled' = @offload_enabled,
               'offload_server' = @offload_server
    END

    RETURN 0
end

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