Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MScheck_agent_instance

  No additional text.


Syntax
create procedure sys.sp_MScheck_agent_instance
    @application_name 	sysname,
    @agent_type 		int = NULL
 
as
    declare @count_pro int
   
    set nocount on
           

    select @count_pro = count(*)
        from sys.dm_exec_sessions
        where program_name = @application_name collate database_default

    -- type 3 is for 7.0 distribution agent backward compatibility.
    if @agent_type = 3
       
    begin
        -- The distribution agent will before connecting to the publisher with unique
           
        -- application name
  
        if @count_pro > 0
    
            raiserror (21036, 16, -1, 'distribution')
          
    end
    -- 10 is 7.5 version of the distribution agent.
            
    else if @agent_type = 10
 
    begin
        -- The distribution agent will connecting to the publisher with unique
        -- application name and then check.
        if @count_pro > 1
    
            raiserror (21036, 16, -1, 'distribution')
          
    end
    else if @agent_type = 4
  
    begin
        -- The merge agent will connect to the publisher with unique application name
            
        -- then call this procedure
        if @count_pro > 1
   
            raiserror (21036, 16, -1, 'merge')
    end
    else if @agent_type = 1
  
    begin
        -- The snapshot agent will connect to the distributiondb with unique application name
    
        -- then call this procedure
        if @count_pro > 2
   
            raiserror (21036, 16, -1, 'snapshot')
    end
    else if @agent_type = 2
  
    begin
        -- The logreader agent will connect to the distributiondb with unique application name
   
        -- then call this procedure
        if @count_pro > 1
    
            raiserror (21036, 16, -1, 'logreader')
             
    end
    else if @agent_type = 9
  
    begin
        -- The queuereader agent will connect to the distributiondb with unique application name
 
        -- then call this procedure
        if @count_pro > 1
   
            raiserror (21036, 16, -1, 'queuereader')
           
    end

 
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