Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MScheck_dynamic_filters

  No additional text.


Syntax


create procedure sys.sp_MScheck_dynamic_filters @publication sysname,
                                        @can_use_partition_groups bit = NULL output,
                                        @has_dynamic_filters bit = NULL output,
                                        @dynamic_filters_function_list nvarchar(500) = NULL output,
                                        @validate_subscriber_info nvarchar(500) = NULL output,
                                        @uses_host_name bit = NULL output,
                                        @uses_suser_sname bit = NULL output,
                                        @dont_raise_error bit = NULL
as
    set nocount on

    declare @pubid uniqueidentifier
    , @retcode int
    , @use_partition_groups smallint
    , @dynamic_filters bit
    , @function_name_contains_another bit

    select @pubid = pubid
    , @dynamic_filters = dynamic_filters
    , @use_partition_groups = use_partition_groups
    from dbo.sysmergepublications
    where name = @publication and UPPER(publisher)=UPPER(publishingservername()) and publisher_db=db_name()
    if @pubid is null
    begin
        raiserror(20026, 16, -1, @publication)
        return (1)
    end

    -- Initialize the flags to such a value that the occurrence of some condition will
    -- set the value to the opposite value.
    set @can_use_partition_groups = 1
    set @has_dynamic_filters = 0
    set @uses_host_name = 0
    set @uses_suser_sname = 0
    set @dynamic_filters_function_list = NULL

    if not exists (select * from dbo.sysmergearticles
                        where pubid = @pubid
                        and subset_filterclause is not null
                        and subset_filterclause <> '')
        and not exists (select * from dbo.sysmergesubsetfilters
                        where pubid = @pubid
                        and (filter_type & 1) = 1)
    begin
        set @can_use_partition_groups = 0

        if (@dont_raise_error is NULL or @dont_raise_error = 0)
        begin
            if @use_partition_groups in (1,2)
            begin
                -- raiserror: Partition groups cannot be used for unfiltered publications.
                raiserror(22512, 16, -1)
                return 1
            end

            if @dynamic_filters = 1
            begin
                raiserror(22516, 16, -1, @publication)
                return 1
            end
        end

        return 0
    end

    exec @retcode = sys.sp_MScheck_join_filters
                                @pubid = @pubid
                                , @use_partition_groups = @use_partition_groups
                                , @dynamic_filters = @dynamic_filters
                                , @can_use_partition_groups = @can_use_partition_groups output
                                , @has_dynamic_filters = @has_dynamic_filters output
                                , @dynamic_filters_function_list = @dynamic_filters_function_list output
                                , @uses_host_name = @uses_host_name output
                                , @uses_suser_sname = @uses_suser_sname output
    if @@error <> 0 or @retcode <> 0
        goto FAILURE

    exec @retcode = sys.sp_MScheck_join_filter_circular_relations
                                @pubid = @pubid
                                , @use_partition_groups = @use_partition_groups
                                , @can_use_partition_groups = @can_use_partition_groups output
    if @@error <> 0 or @retcode <> 0
        goto FAILURE

    exec @retcode = sys.sp_MScheck_blob_filter_columns
                                @pubid = @pubid
                                , @use_partition_groups = @use_partition_groups
                                , @can_use_partition_groups = @can_use_partition_groups output
    if @@error <> 0 or @retcode <> 0
        goto FAILURE

    exec @retcode = sys.sp_MScheck_subset_filters
                                @pubid = @pubid
                                , @use_partition_groups = @use_partition_groups
                                , @dynamic_filters = @dynamic_filters
                                , @can_use_partition_groups = @can_use_partition_groups output
                                , @has_dynamic_filters = @has_dynamic_filters output
                                , @dynamic_filters_function_list = @dynamic_filters_function_list output
                                , @uses_host_name = @uses_host_name output
                                , @uses_suser_sname = @uses_suser_sname output
    if @@error <> 0 or @retcode <> 0
        goto FAILURE

    if @dynamic_filters_function_list is not null
    begin
        exec @retcode = sys.sp_MSget_distinct_semicolon_sep_items @dynamic_filters_function_list = @dynamic_filters_function_list output
        if @@error <> 0 or @retcode <> 0
            goto FAILURE

        select @validate_subscriber_info = replace (@dynamic_filters_function_list, ';', '+')
    end

    if @dynamic_filters = 1 and @has_dynamic_filters = 0 and (@dont_raise_error is NULL or @dont_raise_error = 0)
    begin
        raiserror(22516, 16, -1, @publication)
        goto FAILURE
    end

    return 0

FAILURE:

    return 1

 
Last revision 2008RTM
See also

  sp_check_dynamic_filters (Procedure)
sp_dropmergearticle (Procedure)
sp_MSdrop_rladmin (Procedure)
sp_MSget_dynamic_filters_function_list (Procedure)
sp_MSset_dynamic_filter_options (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