Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_browsesnapshotfolder

  No additional text.


Syntax
create procedure sys.sp_MSrepl_browsesnapshotfolder
(
    @publication    sysname,
    @subscriber     sysname,
    @subscriber_db  sysname,
    @publisher        sysname,
    @publisher_type    sysname
)
AS
BEGIN
    SET NOCOUNT ON
    DECLARE @retcode        INT
    DECLARE @publisher_db   sysname
    DECLARE @distributor    sysname
    DECLARE @distributiondb sysname
    DECLARE @distproc       nvarchar(300)
    DECLARE @article_id     INT

    SELECT @retcode = 0
    SELECT @publisher_db = DB_NAME()
    SELECT @distributor = NULL
    SELECT @distributiondb = NULL
    SELECT @article_id = NULL

    -- Set publisher to be case insensitive by using UPPERCASE
    SELECT    @publisher = UPPER(@publisher)

    EXEC @retcode = dbo.sp_MSreplcheck_publish
    IF @@ERROR <> 0 or @retcode <> 0
        return (1)

    -- Either both of @subscriber and @subscriber_db are NULL or
    -- both of them have to be non-null
    IF ((@subscriber IS NULL OR @subscriber = N'')
        AND @subscriber_db IS NOT NULL AND @subscriber_db <> N'') OR
       ((@subscriber_db IS NULL OR @subscriber_db = N'')
        AND @subscriber IS NOT NULL AND @subscriber <> N'')
    BEGIN
        RAISERROR(21148, 16, -1)
    END

    IF EXISTS (SELECT * FROM sys.objects WHERE name = N'syspublications') AND
       EXISTS (SELECT * FROM sys.objects WHERE name = N'sysextendedarticlesview')
    BEGIN

        -- Set publisher name if not HREPL
        IF (@publisher_type = N'MSSQLSERVER')
        BEGIN
            SELECT    @publisher = publishingservername()
        END

        -- Get the smallest article id for the publication since
        -- method for identifying a publication is not readily available
        -- on the distributor

        IF (@publisher_type = N'MSSQLSERVER')
        BEGIN
            SELECT @article_id = MIN(artid)
            FROM sysextendedarticlesview sa
            INNER JOIN syspublications sp
            ON sa.pubid = sp.pubid
            WHERE sp.name = @publication
        END
        ELSE
        BEGIN
            SELECT    @article_id = MIN(article_id)
            FROM    IHarticles IHA,
                    IHpublications IHP,
                    master.dbo.sysservers ss
            WHERE    IHA.publication_id = IHP.pubid
              AND    IHA.publisher_id = ss.srvid
              AND    IHP.name = @publication
        END

        IF @article_id IS NULL
        BEGIN
            RAISERROR(20026, 16, -1, @publication)
        END

        EXEC @retcode = sys.sp_MSrepl_getdistributorinfo @rpcsrvname = @distributor OUTPUT,
                                               @distribdb = @distributiondb OUTPUT,
                                               @publisher = @publisher
        IF @retcode <> 0
            RETURN @retcode

        SELECT @distributor = RTRIM(@distributor)

        IF LOWER(@@SERVERNAME) <> LOWER(@distributor)
        BEGIN
            SELECT @distproc = @distributor + '.' + @distributiondb +
                               '.dbo.sp_MSbrowsesnapshotfolder'
        END
        ELSE
        BEGIN
            SELECT @distproc = QUOTENAME(@distributiondb) + '.dbo.sp_MSbrowsesnapshotfolder'
        END
        EXECUTE @retcode = @distproc
                    @publisher = @publisher,
                    @publisher_db = @publisher_db,
                    @article_id = @article_id,
                    @subscriber = @subscriber,
                    @subscriber_db = @subscriber_db
        RETURN @retcode
    END
    ELSE
    BEGIN
        RAISERROR(21149, 16, -1, @publisher_db)
        RETURN 1
    END
END

 
Last revision 2008RTM
See also

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