Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSset_subscription_properties

  No additional text.


Syntax
create procedure sys.sp_MSset_subscription_properties
(
    @publisher      sysname,            -- publishing server name
    @publisher_db   sysname,          -- publishing database name. If NULL then same as current db
    @publication    sysname,          -- publication name,
    @subscription_type int,
    @allow_subscription_copy bit,
    @queue_id sysname,
    @update_mode int,
    @attach_version binary(16),
    @queue_server sysname = NULL
)
AS
BEGIN
    set nocount on
    declare @retcode int
                ,@failover_mode bit

    --  Security Check
    EXEC @retcode = sys.sp_MSreplcheck_subscribe
    IF @@ERROR <> 0 or @retcode <> 0
        RETURN(1)

    -- For non independent agent publications
    if @publication is null or @publication = ''
        set @publication = 'ALL'

    if @queue_server = N''
        select @queue_server = NULL

    if @queue_id = N''
        select @queue_id = NULL

    
    -- Failover mode is overloaded in @update_mode
    -- Get the proper values for failover_mode and update_mode
    
    if (@update_mode in (6,7))
    begin
        -- Failover with Queued as the default mode
        if (@update_mode = 6)
        begin
            -- sql queues
            select @update_mode = 5
                     ,@failover_mode = 1
        end
        else
        begin
            -- MQ queues
            select @update_mode = 3
                     ,@failover_mode = 1
        end
    end
    else
    begin
        -- for all other cases, failover_mode should be initialized to 0
        select @failover_mode = 0
    end
    
    -- Update metadata in MSsubscription_agents
    
    update dbo.MSsubscription_agents set
        allow_subscription_copy = @allow_subscription_copy,
        update_mode = @update_mode,
        failover_mode = @failover_mode,
        queue_id = @queue_id,
        queue_server = @queue_server,
        attach_version = @attach_version
    where UPPER(publisher) = UPPER(@publisher)
        and publisher_db =  @publisher_db
        and publication = @publication
        and subscription_type = @subscription_type
    
    -- for queued pull subscriptions
    -- update column update_mode in MSreplication_subscriptions
    -- as we never know the right update_mode until initialization
    
    if ((@subscription_type = 1) and (@queue_id IS NOT NULL) and
    exists (select * from MSreplication_subscriptions
        WHERE UPPER(publisher) = UPPER(@publisher) AND
            publisher_db  = @publisher_db AND
            publication = @publication AND
            subscription_type = @subscription_type))
    begin
        update MSreplication_subscriptions
        set update_mode = @update_mode
        WHERE UPPER(publisher) = UPPER(@publisher) AND
            publisher_db  = @publisher_db AND
            publication = @publication AND
            subscription_type = @subscription_type
    end
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