Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSgetreplnick

  No additional text.


Syntax

create procedure sys.sp_MSgetreplnick
    @server         sysname = NULL,
    @db_name        sysname = NULL,
    @pubid          uniqueidentifier  = NULL,
    @replnick       binary(6) output
as
    if @db_name IS NULL
        select @db_name = db_name()

    if @server is NULL
        begin
        /* If the publisher database is being mirrored - use publishingservername() ( virtual name for publisher server ) for server name */
        if exists (select * from dbo.sysmergesubscriptions where pubid = subid and db_name = @db_name)
        	and exists (select * from sys.database_mirroring where database_id = db_id(@db_name) and mirroring_partner_instance is not NULL)
            select @server = publishingservername()
        else
            select @server = @@servername
        end
    set @replnick= null

    if (@pubid IS NOT NULL)
    begin
        set @replnick = (select top 1 replnickname from dbo.sysmergesubscriptions
            where UPPER(subscriber_server) collate database_default = UPPER(@server) collate database_default
                    and db_name = @db_name and pubid = @pubid)
    end
    else
    begin
        set @replnick = (select top 1 replnickname from dbo.sysmergesubscriptions
            where UPPER(subscriber_server) collate database_default = UPPER(@server) collate database_default
                    and db_name = @db_name and status <> 7) -- REPLICA_STATUS_BeforeRestore
    end


 
Last revision 2008RTM
See also

  sp_addmergearticle (Procedure)
sp_addmergepublication (Procedure)
sp_addmergepullsubscription (Procedure)
sp_addmergesubscription (Procedure)
sp_addtabletocontents (Procedure)
sp_MSaddmergetriggers (Procedure)
sp_MSaddmergetriggers_internal (Procedure)
sp_MSaddupdatetrigger (Procedure)
sp_MScreatedummygeneration (Procedure)
sp_MSdummyupdate (Procedure)
sp_MSdummyupdate90 (Procedure)
sp_MSevaluate_logicalrecordparent (Procedure)
sp_MSevaluate_logicalrecordparent_allcontentsrows (Procedure)
sp_MSgenerateexpandproc (Procedure)
sp_MSinsertgenhistory (Procedure)
sp_MSlevelcontents (Procedure)
sp_MSleveltombstone (Procedure)
sp_MSlocalizeinterruptedgenerations (Procedure)
sp_MSmakegeneration (Procedure)
sp_MSmakegenerationold (Procedure)
sp_MSmakeselectproc (Procedure)
sp_MSmerge_getgencur (Procedure)
sp_MSmerge_metadataupgrade (Procedure)
sp_MSmovegenzerochanges (Procedure)
sp_MSrestoredbreplication (Procedure)
sp_MSrestore_sub_merge (Procedure)
sp_MSscriptviewproc (Procedure)
sp_MSset_logicalrecord_metadata (Procedure)
sp_MSupdategenhistory (Procedure)
sp_MSuplineageversion (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