Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSvalidate_distpublisher

  No additional text.


Syntax
create procedure sys.sp_MSvalidate_distpublisher
(
@publisher sysname,
@publisher_id smallint = NULL OUTPUT
)
as
begin
    set nocount on

    declare @distribution_db sysname
    declare @retcode int

    -- Check if publisher is a defined as a distribution publisher at this distributor
    select @publisher_id = srvid from master.dbo.sysservers where UPPER(srvname) = UPPER(@publisher)
    if @publisher_id is NULL
    begin
        raiserror (14080, 11, -1, @publisher)
        return (1)
    end

    if not exists (select * from msdb.dbo.MSdistpublishers where name = UPPER(@publisher))
    begin
        raiserror (14080, 11, -1, @publisher)
        return (1)
    end


    -- Check if client is in the correct distribution database
    exec @retcode = sys.sp_MSrepl_getdistributorinfo @publisher = @publisher, @distribdb = @distribution_db OUTPUT
    if @@error <> 0 OR @retcode <> 0
    begin
        raiserror (14071, 16, -1)
        return (1)
    end

    -- Check if publisher is associated with a distribution database
    if @distribution_db is NULL
    begin
        raiserror (14071, 16, -1)
        return(1)
    end

    -- Check if client is in the distribution database
    if @distribution_db <> db_name()
    begin
        raiserror(14071, 16, -1)
        return(1)
    end
end

 
Last revision 2008RTM
See also

  sp_instdist (Procedure)
sp_MSadd_article (Procedure)
sp_MSadd_merge_subscription (Procedure)
sp_MSadd_publication (Procedure)
sp_MSadd_subscription (Procedure)
sp_MSchange_article (Procedure)
sp_MSchange_publication (Procedure)
sp_MScleanupdynamicsnapshotfolder (Procedure)
sp_MSdistpublisher_cleanup (Procedure)
sp_MSdrop_article (Procedure)
sp_MSdrop_merge_subscription (Procedure)
sp_MSdrop_publication (Procedure)
sp_MSdrop_subscriber_info (Procedure)
sp_MSdrop_subscription (Procedure)
sp_MSenable_publication_for_het_sub (Procedure)
sp_MSenumerate_PAL (Procedure)
sp_MSinit_publication_access (Procedure)
sp_MSinvalidate_snapshot (Procedure)
sp_MSpublication_access (Procedure)
sp_MSquery_syncstates (Procedure)
sp_MSupdate_subscription (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