Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MScache_agent_parameter

  No additional text.


Syntax
-- This proc caches agent profile paramaters on the subscriber database
create procedure sys.sp_MScache_agent_parameter(
    @profile_name           sysname,
    @parameter_name         sysname,
    @parameter_value        nvarchar(255)
)AS
    declare @slash_parameter_name sysname
    declare @dash_parameter_name sysname
    declare @retcode int

    
    -- security check
    
    exec @retcode = sys.sp_MSreplcheck_subscribe
    if @@ERROR <> 0 or @retcode <> 0
    begin
        return(1)
    end
	
    select @parameter_name = LTRIM(RTRIM(@parameter_name))
    select @parameter_value = LTRIM(RTRIM(@parameter_value))

    -- Append leading '-' when not given
    if (substring(@parameter_name, 1, 1) <> '/' and
        substring(@parameter_name, 1, 1) <> '-')
    BEGIN
        select @parameter_name = N'-' + @parameter_name
    END

    select @slash_parameter_name = lower(stuff(@parameter_name, 1, 1, N'/') collate SQL_Latin1_General_CP1_CS_AS)
    select @dash_parameter_name = lower(stuff(@parameter_name, 1, 1, N'-') collate SQL_Latin1_General_CP1_CS_AS)

    IF exists ( select * from dbo.MSmerge_agent_parameters
            where profile_name = @profile_name and
                (lower(parameter_name collate SQL_Latin1_General_CP1_CS_AS) = @slash_parameter_name collate SQL_Latin1_General_CP1_CS_AS or
                 lower(parameter_name collate SQL_Latin1_General_CP1_CS_AS) = @dash_parameter_name collate SQL_Latin1_General_CP1_CS_AS))
    BEGIN
        update dbo.MSmerge_agent_parameters set value = @parameter_value where
            profile_name = @profile_name and
            (lower(parameter_name collate SQL_Latin1_General_CP1_CS_AS) = @slash_parameter_name collate SQL_Latin1_General_CP1_CS_AS or
            lower(parameter_name collate SQL_Latin1_General_CP1_CS_AS) = @dash_parameter_name collate SQL_Latin1_General_CP1_CS_AS)

        if @@error <> 0
            return(1)
    END
    ELSE
    BEGIN
        insert into dbo.MSmerge_agent_parameters values (@profile_name, @parameter_name, @parameter_value) ;
        if @@error <> 0
            return(1)
    END

 
Last revision 2008RTM
See also

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