Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_createagentparameter

  No additional text.


Syntax
create procedure sys.sp_createagentparameter
(
     @agent_type int -- 1=Snapshot,2=Logreader,3=Distribution,4=Merge,9=Qreader
    ,@parameter_name sysname = NULL
    ,@default_value nvarchar(4000) = NULL -- NULL=no default
    ,@min_value int = NULL -- NULL=no lower bound
    ,@max_value int = NULL -- NULL=no upper bound
)
as
begin
    set nocount on
    -- check if MSagentparameterlist table exists, if not fail
    if not EXISTS (SELECT * FROM msdb.sys.objects WHERE name = 'MSagentparameterlist'
        and type = 'U')
    begin
        --Object MSagentparameterlist does not exist in database msdb
        RAISERROR (15009, 16, -1, 'MSagentparameterlist', 'msdb')
        return 1
    end

    -- insert parameter into the MSagentparameterlist table
    -- print convert(nvarchar, @parameter_name)
    INSERT INTO msdb.dbo.MSagentparameterlist
        (agent_type
        ,parameter_name
        ,default_value
        ,min_value
        ,max_value)
    VALUES
        (@agent_type
        ,@parameter_name
        ,@default_value
        ,@min_value
        ,@max_value)
    -- If a parameter with this name already exists for same agent type
    -- error will be non-zero -> insert failed because of primary key
    if @@error <> 0
    begin
        --Cannot insert parameter [parameter_name] into MSagentparameterlist
        RAISERROR (21803, 16, -1, @parameter_name, 'MSagentparameterlist')
        return 1
    end
end

 
Last revision 2008RTM
See also

  sp_createagentparameterlist (Procedure)
sp_MScreate_distributor_tables (Procedure)
sp_MSdrop_replcom (Procedure)
sp_vupgrade_replmsdb (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