sp_check_join_filter (Transact-SQL)sp_check_join_filter (Transact-SQL)

本主題適用於:是SQL Server (從 2008 開始)否Azure SQL Database否Azure SQL 資料倉儲 否平行處理資料倉儲 THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

用來驗證兩個資料表之間的聯結篩選,以判斷聯結篩選子句是否有效。Is used to verify a join filter between two tables to determine if the join filter clause is valid. 這個預存程序也會傳回有關所提供之聯結篩選的資訊,包括它是否能夠搭配使用給定資料表之預先計算的資料分割。This stored procedure also returns information about the supplied join filter, including if it can be used with precomputed partitions for the given table. 這個預存程序執行於發行集的發行者端。This stored procedure is executed at the Publisher on the publication. 如需詳細資訊,請參閱使用預先計算的資料分割最佳化參數化篩選效能For more information, see Optimize Parameterized Filter Performance with Precomputed Partitions.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax


sp_check_join_filter [ @filtered_table = ] 'filtered_table'  
        , [@join_table = ] 'join_table'  
        , [ @join_filterclause = ] 'join_filterclause'  

引數Arguments

[ @filtered_table =] 'filtered_table'[ @filtered_table= ] 'filtered_table'
這是篩選的資料表名稱。Is the name of a filtered table. filtered_tablenvarchar (400),沒有預設值。filtered_table is nvarchar(400), with no default.

[ @join_table =] 'join_table'[ @join_table= ] 'join_table'
針對聯結的資料表名稱filtered_tableIs the name of a table being joined to filtered_table. join_tablenvarchar (400),沒有預設值。join_table is nvarchar(400), with no default.

[ @join_filterclause =] 'join_filterclause'[ @join_filterclause = ] 'join_filterclause'
這是正在測試的聯結篩選子句。Is the join filter clause being tested. join_filterclausenvarchar (1000),沒有預設值。join_filterclause is nvarchar(1000), with no default.

結果集Result Sets

資料行名稱Column name 資料類型Data type DescriptionDescription
can_use_partition_groupscan_use_partition_groups bitbit 是發行集是否為預先計算的資料分割;其中1表示可以使用指出資料分割,以及0表示,無法使用。Is if the publication qualifies for precomputed partitions; where 1 means that precomupted partitions can be used, and 0 means that they cannot be used.
has_dynamic_filtershas_dynamic_filters bitbit 提供的篩選子句包含至少一個參數化篩選函數。其中1表示會使用參數化篩選函數,以及0表示,不會使用這類函式。Is if the supplied filter clause includes at least one parameterized filtering function; where 1 means that a parameterized filtering function is used, and 0 means that such a function is not used.
dynamic_filters_function_listdynamic_filters_function_list nvarchar (500)nvarchar(500) 篩選子句中定義發行項參數化篩選的函數清單,其中每個函數皆以分號加以分隔。List of the functions in the filter clause that define a parameterized filter for an article, where each function is separated by a semi-colon.
uses_host_nameuses_host_name bitbit 如果host_name ()函數是否用於篩選子句中,其中1表示存在於此函式。If the HOST_NAME() function is used in the filter clause, where 1 means that this function is present.
uses_suser_snameuses_suser_sname bitbit 如果suser_sname ()函數是否用於篩選子句中,其中1表示存在於此函式。If the SUSER_SNAME() function is used in the filter clause, where 1 means that this function is present.

傳回碼值Return Code Values

0 (成功) 或1 (失敗)0 (success) or 1 (failure)

備註Remarks

sp_check_join_filter用於合併式複寫中。sp_check_join_filter is used in merge replication.

sp_check_join_filter可以執行對任何相關資料表中,即使它們尚未發行。sp_check_join_filter can be executed against any related tables even if they are not published. 在定義兩個發行項之間的聯結篩選之前,您可以使用這個預存程序,先驗證聯結篩選子句。This stored procedure can be used to verify a join filter clause before defining a join filter between two articles.

PermissionsPermissions

只有成員sysadmin固定的伺服器角色或db_owner固定的資料庫角色可以執行sp_check_join_filterOnly members of the sysadmin fixed server role or db_owner fixed database role can execute sp_check_join_filter.

請參閱<See Also

複寫預存程序 (Transact-SQL)Replication Stored Procedures (Transact-SQL)