Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_helpreplicationdboptionex

  No additional text.


Syntax

-- Name: sp_MSrepl_helpreplicationdboptionex

-- Descriptions: called on publishing db to determine
-- if the db has publications or pull subscriptions
-- used by sp_helpreplicationdboption when @reserved = 1
-- This SP assumes the existence of #replicationdbs

-- Parameters: as defined in create statement

-- Returns: 0 - success
--          1 - Otherwise

-- Security: Internal
-- Requires Certificate signature for catalog access

create procedure sys.sp_MSrepl_helpreplicationdboptionex
(
    @name sysname
    ,@transpublish bit
    ,@mergepublish bit
)
as
begin
    set nocount on
    declare @haspublication bit
                ,@haspullsubscriptions bit

    
    -- look for ANY active publication
    
    if (@transpublish = 1 and object_id(N'dbo.syspublications') is not null)
    begin
        if exists (select * from dbo.syspublications where status != 0)
            select @haspublication = 1
    end
    if (isnull(@haspublication, 0) != 1 and @mergepublish = 1 and object_id(N'dbo.sysmergepublications') is not null)
    begin
        if exists (select * from dbo.sysmergepublications where status != 0 and UPPER(publisher) = UPPER(publishingservername()) and
                                                                                publisher_db = @name)
            select @haspublication = 1
    end
    
    -- look for ANY pull subscription
    
    if (object_id(N'dbo.MSreplication_subscriptions') is not null)
    begin
        if exists (select * from dbo.MSreplication_subscriptions where subscription_type = 1)
            select @haspullsubscriptions = 1
    end
    if (isnull(@haspullsubscriptions, 0) != 1  and object_id(N'dbo.sysmergesubscriptions') is not null)
    begin
        if exists (select * from dbo.sysmergesubscriptions where UPPER(subscriber_server) = UPPER(@@SERVERNAME) and
                                                                            db_name = @name and subscription_type = 1)
            select @haspullsubscriptions = 1
    end
    
    -- updated table #replicationdbs
    
    update #replicationdbs
    set haspublications = isnull(@haspublication, 0)
        ,haspullsubscriptions = isnull(@haspullsubscriptions, 0)
    where name = @name
    
    -- all done
    
    return 0
end

 
Last revision 2008RTM
See also

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