Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSget_current_subscriber_partition_id

  No additional text.


Syntax

create procedure sys.sp_MSget_current_subscriber_partition_id (@pubid uniqueidentifier, @partition_id int output)
as
begin
    declare @retcode int
    declare @pub_uses_host_name_for_filtering bit
    declare @pub_uses_suser_sname_for_filtering bit
    declare @host_name sysname
    declare @suser_sname sysname
    declare @publication sysname

    set @pub_uses_host_name_for_filtering = 0
    set @pub_uses_suser_sname_for_filtering = 0
    select @host_name = NULL
    select @suser_sname = NULL
    select @partition_id = -1

    exec sys.sp_MSget_dynamic_filtering_information @pubid = @pubid,
                @uses_host_name = @pub_uses_host_name_for_filtering OUTPUT,
                @uses_suser_sname = @pub_uses_suser_sname_for_filtering OUTPUT
    if @@error <> 0
        goto FAILURE

    if @pub_uses_host_name_for_filtering = 1
        select @host_name = HOST_NAME()

    if @pub_uses_suser_sname_for_filtering = 1
        select @suser_sname = SUSER_SNAME()

    -- find the partition id for the subscriber
    -- deriving the partition id here and not accepting it as a parameter (from the merge agent)
    -- helps in avoiding false identity.
    select @publication = name from dbo.sysmergepublications where pubid=@pubid
    exec @retcode = sys.sp_MSget_subscriber_partition_id
                            @publication = @publication,
                            @partition_id = @partition_id OUTPUT,
                            @maxgen_whenadded = NULL,
                            @host_name_override = @host_name,
                            @suser_sname_override = @suser_sname
    if @@error <> 0 or @retcode <> 0 or @partition_id = -1
    begin
        raiserror(20629, 16, -1)
        goto FAILURE
    end

    return 0

FAILURE:
    select @partition_id=NULL
    return 1
end

 
Last revision 2008RTM
See also

  sp_MScheck_subscription_partition (Procedure)
sp_MSdrop_rladmin (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