Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSmerge_validate_publication_presence

  No additional text.


Syntax
create procedure sys.sp_MSmerge_validate_publication_presence (
    @publication sysname,
    @dbname sysname,
    @servername sysname,
    @pubid uniqueidentifier output
) AS

    if (@publication is null)
    begin
        RAISERROR(14043, 16, -1, '@publication', 'sp_MSmerge_validate_publication_presence')
        return (1)
    end

    if @dbname is NULL
        select @dbname = db_name()

    if @servername is NULL
        select @servername = @@servername

    /* If the database is being mirrored, then compare the publisher to @servername and to the partner server name */
    declare @mirroring_partner_instance sysname
    set @mirroring_partner_instance = NULL
    select @mirroring_partner_instance = mirroring_partner_instance from sys.database_mirroring where database_id = db_id(@dbname)
    if @mirroring_partner_instance is not NULL
        begin
            select @pubid = pubid from dbo.sysmergepublications where name = @publication and (upper(publisher) = upper(@@servername) or (upper(publisher) = upper(@mirroring_partner_instance))) and publisher_db = @dbname
        end
    else
        begin
            select @pubid = pubid from dbo.sysmergepublications where name = @publication and upper(publisher) = upper(@servername) and publisher_db = @dbname
        end
    if @pubid is NULL
    begin
        if (is_member('db_owner') = 1)
        begin
            RAISERROR (20026, 16, -1, @publication)
            RETURN (1)
        end
        else
        begin
            RAISERROR (21423, 16, -1, @publication)
            RETURN (1)
        end
    end

    if {fn ISPALUSER(@pubid)} <> 1
    begin
        RAISERROR (21423, 16, -1, @publication)
        RETURN (1)
    end


 
Last revision 2008RTM
See also

  sp_MScomputemergearticlescreationorder (Procedure)
sp_MScomputemergeunresolvedrefs (Procedure)
sp_MScreatemergedynamicsnapshot (Procedure)
sp_MScreate_article_repl_views (Procedure)
sp_MSdrop_rladmin (Procedure)
sp_MSenumpubreferences (Procedure)
sp_MSgetreplicainfo (Procedure)
sp_MSgetsupportabilitysettings (Procedure)
sp_MShelpmergeidentity (Procedure)
sp_MShelpmergeschemaarticles (Procedure)
sp_MSinsertgenerationschemachanges (Procedure)
sp_MSsetconflicttable (Procedure)
sp_MSsetreplicainfo (Procedure)
sp_MSuploadsupportabilitydata (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