Share via


sp_articlecolumn (Transact-SQL)

Dikey bir yayınlanan verilere filtre için bir makale dahil sütunları belirtmek için kullanılan tablo.Bu saklı yordam, yayın veritabanı üzerinde yayımcı adresindeki yürütülür.

Konu bağlantısı simgesiTransact-sql sözdizimi kuralları

Sözdizimi

sp_articlecolumn [ @publication = ] 'publication'
        , [ @article = ] 'article'
    [ , [ @column = ] 'column' ]
    [ , [ @operation = ] 'operation' ]
    [ , [ @refresh_synctran_procs = ] refresh_synctran_procs ]
    [ , [ @ignore_distributor = ] ignore_distributor ]
    [ , [ @change_active = ] change_actve ]
    [ , [ @force_invalidate_snapshot = ] force_invalidate_snapshot ]
    [ , [ @force_reinit_subscription = ] force_reinit_subscription ]
    [ , [ @publisher = ] 'publisher' ]
    [ , [ @internal = ] 'internal' ]

Bağımsız değişkenler

  • [ @publication=] 'publication'
    Is the name of the publication that contains this article.publication is sysname, with no default.

  • [ @article=] 'article'
    Is the name of the article.article is sysname, with no default.

  • [ @column=] 'column'
    Is the name of the column to be added or dropped.column is sysname, with a default of NULL.Tüm sütunlar null ise yayınlanır.

  • [ @operation=] 'operation'
    Specifies whether to add or drop columns in an article.operation is nvarchar(5), with a default of add.add marks the column for replication.drop unmarks the column.

  • [ @refresh_synctran_procs=] refresh_synctran_procs
    Specifies whether the stored procedures supporting immediate updating subscriptions are regenerated to match the number of columns replicated.refresh_synctran_procs is bit, with a default of 1.If 1, the stored procedures are regenerated.

  • [ @ignore_distributor =] ignore_distributor
    Indicates if this stored procedure executes without connecting to the Distributor.ignore_distributor is bit, with a default of 0.If 0, the database must be enabled for publishing, and the article cache should be refreshed to reflect the new columns replicated by the article.If 1, allows article columns to be dropped for articles that reside in an unpublished database; should be used only in recovery situations.

  • [ @change_active = ] change_active
    Allows modifying the columns in publications that have subscriptions.change_active is an int with a default of 0.If 0, columns are not modified.If 1, columns can be added or dropped from active articles that have subscriptions.

  • [ @force_invalidate_snapshot = ] force_invalidate_snapshot
    Acknowledges that the action taken by this stored procedure may invalidate an existing snapshot.force_invalidate_snapshot is a bit, with a default of 0.

    0 , değişiklikleri belirtir makale anlık görüntü geçersiz olarak neden olmaz.Saklı yordam, yeni bir anlık görüntü gerektirecek bir değişiklik algılarsa, bir hata oluşur ve değişiklik yapılmaz.

    1 , geçersiz olduğu anlık makale değişiklikler neden olabilir ve yeni bir anlık görüntü gerektirecek varolan abonelikleri varsa varolan anlık görüntü geçersiz olarak işaretlenmesi için izin verir ve yeni bir anlık görüntü oluşturulan belirtir.

  • [@force_reinit_subscription = ] force_reinit_subscription
    Acknowledges that the action taken by this stored procedure may require existing subscriptions to be reinitialized.force_reinit_subscription is a bit, with a default of 0.

    0 makale değişiklikleri abonelik yeniden neden belirtir.Saklı yordam yeniden için abonelikleri değişikliği gerektirecek algılarsa, bir hata oluşur ve değişiklik yapılmaz.1 , değişiklikleri belirtir makale yeniden, varolan abonelikleri neden ve gerçekleşmesi abonelik reinitialization izni verir.

  • [ @publisher= ] 'publisher'
    Specifies a non-Microsoft SQL Server Publisher.publisher is sysname, with a default of NULL.

    Not

    publisherile kullanılmamalıdır bir SQL Server Yayımcı.

  • [ @internal= ] 'internal'
    Yalnızca iç kullanım.

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (başarısız)

Açıklamalar

sp_articlecolumn anlık görüntü çoğaltması çoğaltması çoğaltma ve işlem çoğaltma kullanılır.

Aboneliği bir makale kullanarak filtre uygulanabilir sp_articlecolumn.

Örnek

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

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü veya db_owner sabit veritabanı rolü olabilir yürütmek sp_articlecolumn.