Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSgenreplnickname

  No additional text.


Syntax

create procedure sys.sp_MSgenreplnickname
    @srcguid        uniqueidentifier,
    @replnick        varbinary(6) output,
    @compatlevel    int = 10    -- backward compatibility level, default=Sphinx
as
    declare @maxlevel int

    select @maxlevel= sys.fn_MSgetmaxbackcompatlevel()
    if @compatlevel > @maxlevel
        set @maxlevel= @compatlevel

    -- we neither want duplicate replnicks, nor those that are between 0x010000000000 and 0xFF0000000000 (used for mergenicks)
    
    -- if no publication requires at least Yukon compatibility, the last 2 bytes of the
    -- generated nickname have to be 0x0000.

    while 1=1
    begin
        if @maxlevel >= 80
            set @replnick= cast(reverse(substring(convert(binary(16), @srcguid),1,6)) as binary(6))
        else
            set @replnick= cast(reverse(substring(convert(binary(16), @srcguid),1,4)) as binary(4)) + 0x0000

        -- Values 0..255 are reserved for merge nicknames
        if substring(@replnick,2,5) = 0x0000000000 and
           substring(@replnick,1,1) > 0x00 and
           substring(@replnick,1,1) <= 0xFF
        begin
            set @srcguid= newid()
            continue
        end

        -- Do not use existing nicknames from neither hws nor lws
        if object_id('dbo.sysmergesubscriptions', 'U') is not null
        begin
            if exists (select replnickname from dbo.sysmergesubscriptions where replnickname = @replnick)
            begin
                set @srcguid= newid()
                continue
            end
        end
        -- When we get here, the generated nickname is okay.
        break
    end

 
Last revision 2008RTM
See also

  sp_addmergepublication (Procedure)
sp_addmergepullsubscription (Procedure)
sp_addmergesubscription (Procedure)
sp_MSaddinitialsubscription (Procedure)
sp_MScheck_subscription_partition (Procedure)
sp_MScreateglobalreplica (Procedure)
sp_MSrestoredbreplication (Procedure)
sp_MSrestore_sub_merge (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