sp_articlecolumn (języka Transact-SQL)
Służy do określania kolumn znajdujących się w artykuł pionowo filtrowanie danych w tabela opublikowane.Ta procedura składowana jest wykonywany na Wydawca na bazie publikacja.
Składnia
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' ]
Argumenty
[ @ publikacja = 'publication"
Is the name of the publication that contains this article.publication is sysname, with no default.[ @ artykuł = 'article"
Is the name of the article.article is sysname, with no default.[ @ kolumna = 'column"
Is the name of the column to be added or dropped.column is sysname, with a default of NULL.Jeśli ma wartość NULL, wszystkie kolumny są publikowane.[ @ operacji = '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.Jeśli 1, procedury przechowywane są generowane.[ @ ignore_distributor = ignore_distributor
Indicates if this stored procedure executes without connecting to the Distributor.ignore_distributor is bit, with a default of 0.Jeśli 0, baza danych musi być włączony do publikowania i pamięci podręcznej artykuł powinny być odświeżane, aby odzwierciedlić nowe kolumny, które są replikowane w artykule.Jeśli 1, umożliwia artykuł kolumny ma być przerwane artykułów, które znajdują się w bazie nieopublikowanych powinny być używane tylko w sytuacjach odzyskiwanie.[ @ change_active = change_active
Allows modifying the columns in publications that have subscriptions.change_active is an int with a default of 0.Jeśli 0, kolumny nie są modyfikowane.Jeśli 1, można dodać kolumny lub porzucone z aktywnego artykułów, które mają subskrypcje.[ @ 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 określa zmiany artykuł nie powodują migawka się nieprawidłowy.Jeżeli procedura składowana wykryje, że zmiana wymaga Nowa migawka, wystąpi błąd i nie wprowadzono żadnych zmian.
1 Określa, że zmiany w artykuł może spowodować migawki nieprawidłowa, a w przypadku istniejących subskrypcji, wymagające Nowa migawka daje uprawnienie dla istniejących migawki oznaczony jako przestarzałe i Nowa migawka generowane.
[@ 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 Określa, że nie powodują zmiany artykuł subskrypcja do należy ponownie zainicjować.Jeżeli procedura składowana wykryje, że zmiana wymaga subskrypcji należy ponownie zainicjować, wystąpi błąd i nie wprowadzono żadnych zmian.1 Określa, że zmiany w artykuł spowodować istniejących subskrypcja należy ponownie zainicjować i daje uprawnienie dla ponownego zainicjowania subskrypcja występuje.
[ @publisher= ] 'publisher'
Specifies a non-Microsoft SQL Server Publisher.publisher is sysname, with a default of NULL.Ostrzeżenie
publishernie może być używana z SQL Server Wydawca.
[ @internal= ] 'internal'
Tylko do użytku wewnętrznego.
Wartości kodów powrotnych
0 (sukces) lub 1 (błąd)
Uwagi
sp_articlecolumn w replikacja migawka i replikacja transakcyjna.
Tylko objętych subskrypcją artykuł można filtrować przy użyciu sp_articlecolumn.
Przykład
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
Uprawnienia
Tylko członkowie sysadmin stała rola serwera lub db_owner ustaloną rola bazy danych można wykonać sp_articlecolumn.
Zobacz także