적용 대상: SQL Server
게시된 테이블의 데이터를 열 필터링하기 위해 아티클에 포함된 열을 지정하는 데 사용합니다. 이 저장 프로시저는 게시 데이터베이스의 게시자에서 실행됩니다.
구문
sp_articlecolumn
[ @publication = ] N'publication'
, [ @article = ] N'article'
[ , [ @column = ] N'column' ]
[ , [ @operation = ] N'operation' ]
[ , [ @refresh_synctran_procs = ] refresh_synctran_procs ]
[ , [ @ignore_distributor = ] ignore_distributor ]
[ , [ @change_active = ] change_active ]
[ , [ @force_invalidate_snapshot = ] force_invalidate_snapshot ]
[ , [ @force_reinit_subscription = ] force_reinit_subscription ]
[ , [ @publisher = ] N'publisher' ]
[ , [ @internal = ] internal ]
[ ; ]
인수
[ @publication = ] N'publication'
이 문서를 포함하는 게시의 이름입니다. @publication 기본값이 없는 sysname입니다.
[ @article = ] N'article'
아티클의 이름입니다. @article 기본값이 없는 sysname입니다.
[ @column = ] N'column'
추가하거나 삭제할 열의 이름입니다. @column sysname이며 기본값은 .입니다NULL. 이 경우 NULL모든 열이 게시됩니다.
[ @operation = ] N'operation'
아티클에 열을 추가하거나 삭제할지 여부를 지정합니다. @operation 기본값add인 nvarchar(5)입니다.
add는 복제를 위해 열을 표시합니다.drop열의 표시를 해제합니다.
[ @refresh_synctran_procs = ] refresh_synctran_procs
즉시 업데이트 구독을 지원하는 저장 프로시저가 복제된 열 수와 일치하도록 다시 생성되는지 여부를 지정합니다. @refresh_synctran_procs 비트이며 기본값은 .입니다1. 이 경우 1저장 프로시저가 다시 생성됩니다.
[ @ignore_distributor = ] ignore_distributor
이 저장 프로시저가 배포자에 연결되지 않고 실행되는지 여부를 표시합니다. @ignore_distributor 비트이며 기본값은 .입니다0.
- 데이터베이스를 게시할 수 있도록 설정해야 하는 경우
0아티클에서 복제한 새 열을 반영하도록 아티클 캐시를 새로 고쳐야 합니다. - 게시되지 않은 데이터베이스에 있는 아티클에 대해 아티클 열을 삭제할 수 있는 경우
1복구 상황에서만 사용해야 합니다.
[ @change_active = ] change_active
구독이 있는 게시의 열을 수정할 수 있습니다. @change_active 기본값0인 int입니다.
- 이면
0열이 수정되지 않습니다. - 이 경우
1구독이 있는 활성 아티클에서 열을 추가하거나 삭제할 수 있습니다.
[ @force_invalidate_snapshot = ] force_invalidate_snapshot
이 저장 프로시저에서 수행한 작업이 기존 스냅샷을 무효화할 수 있음을 인정합니다. @force_invalidate_snapshot 비트이며 기본값은 .입니다0.
0는 아티클을 변경해도 스냅샷이 잘못되지 않도록 지정합니다. 저장 프로시저에서 변경에 새 스냅샷이 필요하다는 것을 감지하면 오류가 발생하고 변경되지 않습니다.1는 아티클을 변경하면 스냅샷이 유효하지 않을 수 있으며, 새 스냅샷이 필요한 기존 구독이 있는 경우 기존 스냅샷을 사용되지 않는 것으로 표시하고 생성된 새 스냅샷에 대한 권한을 부여합니다.
[ @force_reinit_subscription = ] force_reinit_subscription
이 저장 프로시저에서 수행한 작업에 기존 구독을 다시 초기화해야 할 수 있음을 인정합니다. @force_reinit_subscription 비트이며 기본값은 .입니다0.
0는 아티클을 변경해도 구독이 다시 초기화되지 않도록 지정합니다. 저장 프로시저에서 변경 내용이 구독을 다시 초기화해야 한다는 것을 감지하면 오류가 발생하고 변경되지 않습니다.1는 아티클을 변경하면 기존 구독이 다시 초기화되고 구독 다시 초기화가 발생할 수 있는 권한을 부여하도록 지정합니다.
[ @publisher = ] N'publisher'
SQL Server 이외 게시자를 지정합니다. @publisher sysname이며 기본값은 .입니다NULL.
@publisher SQL Server 게시자에 사용하면 안 됩니다.
[ @internal = ] internal
정보를 제공하기 위해서만 확인됩니다. 지원 안 됨. 향후 호환성은 보장되지 않습니다.
반환 코드 값
0(성공) 또는 1(실패).
설명
sp_articlecolumn 는 스냅샷 복제 및 트랜잭션 복제에 사용됩니다.
을 사용하여 sp_articlecolumn구독되지 않은 아티클만 필터링할 수 있습니다.
예제
DECLARE @publication AS sysname;
DECLARE @table AS sysname;
DECLARE @filterclause AS nvarchar(500);
DECLARE @filtername AS nvarchar(386);
DECLARE @schemaowner AS sysname;
SET @publication = N'AdvWorksProductTran';
SET @table = N'Product';
SET @filterclause = N'[DiscontinuedDate] IS NULL';
SET @filtername = N'filter_out_discontinued';
SET @schemaowner = N'Production';
-- Add a horizontally and vertically filtered article for the Product table.
-- Manually set @schema_option to ensure that the Production schema
-- is generated at the Subscriber (0x8000000).
EXEC sp_addarticle
@publication = @publication,
@article = @table,
@source_object = @table,
@source_owner = @schemaowner,
@schema_option = 0x80030F3,
@vertical_partition = N'true',
@type = N'logbased',
@filter_clause = @filterclause;
-- (Optional) Manually call the stored procedure to create the
-- horizontal filtering stored procedure. Since the type is
-- 'logbased', this stored procedures is executed automatically.
EXEC sp_articlefilter
@publication = @publication,
@article = @table,
@filter_clause = @filterclause,
@filter_name = @filtername;
-- Add all columns to the article.
EXEC sp_articlecolumn
@publication = @publication,
@article = @table;
-- Remove the DaysToManufacture column from the article
EXEC sp_articlecolumn
@publication = @publication,
@article = @table,
@column = N'DaysToManufacture',
@operation = N'drop';
-- (Optional) Manually call the stored procedure to create the
-- vertical filtering view. Since the type is 'logbased',
-- this stored procedures is executed automatically.
EXEC sp_articleview
@publication = @publication,
@article = @table,
@filter_clause = @filterclause;
GO
사용 권한
sysadmin 고정 서버 역할 또는 db_owner 고정 데이터베이스 역할의 멤버만 실행할 sp_articlecolumn수 있습니다.