Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSupdate_mqserver_subdb

  No additional text.


Syntax
create procedure sys.sp_MSupdate_mqserver_subdb
as
begin
    if exists (select * from dbo.MSsubscription_agents
        where queue_id IS NOT NULL and queue_id != N'mssqlqueue' and queue_server IS NULL)
    begin
        
        -- we have entries for active Queued subscriptions using MSMQ that need upgrade
        
        declare @queue_server sysname
                ,@publisher sysname
                ,@publisher_db sysname
                ,@publication sysname

        DECLARE hC CURSOR LOCAL FAST_FORWARD FOR
            select publisher, publisher_db, publication
            from dbo.MSsubscription_agents
            where queue_id IS NOT NULL
                and queue_id != N'mssqlqueue'
                and queue_server IS NULL

        OPEN hC
        FETCH hC INTO @publisher, @publisher_db, @publication
        WHILE (@@fetch_status != -1)
        BEGIN
            
            -- the table MSsubscription_properties has to exist;
            -- prepare the queue server name from distributor name
            -- strip the instance name if necessary
            
            select @queue_server = ISNULL(distributor, @@servername)
            from dbo.MSsubscription_properties
            where UPPER(publisher) = UPPER(@publisher) and
                        publisher_db = @publisher_db and
                        publication = @publication

            if (charindex(N'\', @queue_server) > 0)
                select @queue_server = substring(@queue_server, 1, charindex(N'\', @queue_server) - 1)

            
            -- set the queue_server for this entry
            
            update dbo.MSsubscription_agents
            set queue_server = @queue_server
            where UPPER(publisher) = UPPER(@publisher) and
                        publisher_db = @publisher_db and
                        publication = @publication

            
            -- get next entry
            
            FETCH hC INTO @publisher, @publisher_db, @publication
        END
        CLOSE hC
        DEALLOCATE hC
    end
end

 
Last revision 2008RTM
See also

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