Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_createagentparameterlist

  No additional text.


Syntax
create procedure sys.sp_createagentparameterlist
as
begin
    set nocount on
    declare  @snapshot_type      int
                ,@logreader_type     int
                ,@distribution_type  int
                ,@merge_type         int
                ,@qreader_type       int
                ,@retcode int

    -- check if table msdb.dbo.MSagentparameterlist exists, if so
    -- drop and recreate it
    IF EXISTS (SELECT * FROM msdb.sys.objects WHERE name = 'MSagentparameterlist'
        and type = 'U')
    begin
        DROP TABLE msdb.dbo.MSagentparameterlist
        if @@error<> 0
        begin
            --Could not drop the table
            RAISERROR (21499, 16, -1, 'sys.sp_createagentparameterlist', 'drop', 'msdb.dbo.MSagentparameterlist', @@error)
            return 1
        end
    end

    create table msdb.dbo.MSagentparameterlist
    (
        agent_type tinyint NOT NULL, -- 1=Snapshot,2=Logreader,3=Distribution,4=Merge,9=Qreader
        parameter_name sysname NOT 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
        CONSTRAINT pk_MSagentparameterlist PRIMARY KEY (agent_type, parameter_name)
    )

    if @@error<> 0
    begin
        --Could not create/recreate the table
        RAISERROR (21499, 16, -1, 'sys.sp_createagentparameterlist', 'create', 'msdb.dbo.MSagentparameterlist', @@error)
        return 1
    end

    exec @retcode = msdb.dbo.sp_MS_marksystemobject 'dbo.MSagentparameterlist'
    if @@error<> 0
    begin
        --Could not mark table as system
        RAISERROR (21755, 16, -1, 'dbo.MSagentparameterlist')
        return 1
    end

    
    -- add all the parameters by calling sp_createagentparameter for each 

    --initialize the constants
    select @snapshot_type = 1
            ,@logreader_type = 2
            ,@distribution_type = 3
            ,@merge_type = 4
            ,@qreader_type = 9

    -- add params for snapshot
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'BcpBatchSize', 100000, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'HistoryVerboseLevel', 2, 0, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'LoginTimeout', 15, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'MaxBcpThreads',	1, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'QueryTimeout', 1800, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'StartQueueTimeout', 0, 0, 300
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'MaxNetworkOptimization', 1, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'70Subscribers', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'Output', NULL, NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'OutputVerboseLevel', 1, 0, 2
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'PacketSize', 8192, 512, 32767
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'UsePerArticleContentsView', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @snapshot_type, N'PublisherFailoverPartner', null, null, null
    if @retcode=1 goto CLEANUP
    -- add params for logreader
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'HistoryVerboseLevel', 1, 0, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'LoginTimeout', 15, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'PollingInterval', 5, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'QueryTimeout', 1800, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'ReadBatchSize', 500, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'MessageInterval', 3600, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'Output', NULL, NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'OutputVerboseLevel', 0, 0, 2
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'PacketSize', 4096, 0, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'ReadBatchThreshold', 0, 0, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'LogScanThreshold', 500000, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @logreader_type, N'PublisherFailoverPartner', null, null, null
    if @retcode=1 goto CLEANUP
    -- add params for distribution
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'BcpBatchSize', 0, 0, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'CommitBatchSize', 100, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'CommitBatchThreshold', 1000, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'HistoryVerboseLevel', 2, 0, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'LoginTimeout', 15, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'MaxBcpThreads', 1, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'MaxDeliveredTransactions', 0, 0, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'PollingInterval', 5, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'QueryTimeout', 1800, 0, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'TransactionsPerHistory', 100, 0, 10000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'SkipErrors', '', NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type,  N'KeepAliveMessageInterval', 300, 30, NULL
    if @retcode=1 goto CLEANUP
    --exec @retcode = sys.sp_createagentparameter @distribution_type, N'UseInprocLoader', 0, 0, 1
    --if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'Output', NULL, NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'OutputVerboseLevel', 0, 0, 2
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'FileTransferType', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'MessageInterval', 3600, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'PacketSize', 4096, 0, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'QuotedIdentifier', ' ', NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'UseOledbStreaming', NULL, NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @distribution_type, N'OledbStreamThreshold', 32768, 400, 1048576
    if @retcode=1 goto CLEANUP
    -- add params for merge
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'StartQueueTimeout', 0, NULL, 300
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'PollingInterval', 60, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'ValidateInterval', 60, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'LoginTimeout', 15, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'QueryTimeout', 300, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'MaxUploadChanges', 0, NULL, 300
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'MaxDownloadChanges', 0, NULL, 300
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'UploadGenerationsPerBatch', 50, 1, 2000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'DownloadGenerationsPerBatch', 50, 1, 2000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'UploadReadChangesPerBatch', 100, 1, 2000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'DownloadReadChangesPerBatch', 100, 1, 2000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'UploadWriteChangesPerBatch', 100, 1, 2000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'DownloadWriteChangesPerBatch', 100, 1, 2000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'Validate', 0, 0, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,	N'FastRowCount', 1, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'HistoryVerboseLevel', 2, 0, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'ChangesPerHistory', 100, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'BcpBatchSize', 100000, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'NumDeadlockRetries', 5, 1, 100
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'KeepAliveMessageInterval', 300, 30, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'SrcThreads', 1, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'DestThreads', 1, 1, NULL
    if @retcode=1 goto CLEANUP
    --exec @retcode = sys.sp_createagentparameter @merge_type,  N'UseInprocLoader', 0, 0, 1
    --if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'MetadataRetentionCleanup', 1, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'ParallelUploadDownload', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type,  N'GenerationChangeThreshold', 1000, 0, 100000
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'Output', NULL, NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'OutputVerboseLevel', 0, 0, 2
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'ExchangeType', 3, 1, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'FileTransferType', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'InteractiveResolution', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'MaxBcpThreads', null, 1, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'PacketSize', null, 1, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'UseInprocLoader', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'ProcessMessagesAtPublisher', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'ProcessMessagesAtSubscriber', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'SyncToAlternate', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'QueueSizeMultiplier', null, 1, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'AltSnapshotFolder', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'DynamicSnapshotLocation', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'InputMessageFile', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'OutputMessageFile', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'InterruptOnMessagePattern', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'PauseOnMessagePattern', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'PauseTime', null, 1, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'PublisherFailoverPartner', null, null, null
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'ForceEnumerationAsPal', 0, 0, 1
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @merge_type, N'MakeGenerationInterval', 1, 0, null
    if @retcode=1 goto CLEANUP

    -- add params for qreader
    exec @retcode = sys.sp_createagentparameter @qreader_type,  N'ResolverState', 1, 1, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type,  N'SQLQueueMode', 0, 0, 2
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type,  N'HistoryVerboseLevel', 1, 0, 3
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type,  N'PollingInterval', 5, 1, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type,  N'LoginTimeout', 15, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type,  N'QueryTimeout', 1800, 1, 65534
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type, N'Output', NULL, NULL, NULL
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type, N'OutputVerboseLevel', 1, 0, 2
    if @retcode=1 goto CLEANUP
    exec @retcode = sys.sp_createagentparameter @qreader_type, N'PublisherFailoverPartner', null, null, null
    if @retcode=1 goto CLEANUP

    -- all done
    return 0
CLEANUP:
    --Call to sp_createagentparameter from msdb.dbo.MSagentparameterlist failed. Not creating any more parameters.
    RAISERROR (21801, 16, -1)
    return 1
end

 
Last revision 2008RTM
See also

  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