sp_dropmergearticle (języka Transact-SQL)

Artykuł usuwa z publikacja korespondencji seryjnej.Ta procedura składowana jest wykonywany na Wydawca na bazie publikacja.

Ikona łącza do tematuKonwencje składni Transact-SQL

Składnia

sp_dropmergearticle [ @publication= ] 'publication'
        , [ @article= ] 'article' 
    [ , [ @ignore_distributor= ] ignore_distributor 
    [ , [ @reserved= ] reserved 
    [ , [ @force_invalidate_snapshot= ] force_invalidate_snapshot ]
    [ , [ @force_reinit_subscription = ] force_reinit_subscription ]
    [ , [ @ignore_merge_metadata = ] ignore_merge_metadata ]

Argumenty

  • [ @ publikacja = 'publication"
    Is the name of the publication from which to drop an article.publicationis sysname, with no default.

  • [ @ artykuł = 'article"
    Is the name of the article to drop from the given publication.articleis sysname, with no default.Jeśli wszystkich, wszystkie istniejące artykuły w publikacja seryjnej określone są usuwane.Nawet jeśli article jest wszystkich, publikacja nadal musi być odrzucone oddzielnie od artykuł.

  • [ @ ignore_distributor = ignore_distributor
    Indicates whether this stored procedure is executed without connecting to the Distributor.ignore_distributor is bit, with a default of 0.

  • [ @ zarezerwowane = reserved
    Is reserved for future use.reserved is nvarchar(20), with a default of NULL.

  • [ @ force_invalidate_snapshot = force_invalidate_snapshot
    Enables or disables the ability to have a snapshot invalidated.force_invalidate_snapshot is a bit, with a default 0.

    0 określa zmiany artykuł korespondencji seryjnej nie powodują migawka się nieprawidłowy.

    1 oznacza, że zmiany artykuł korespondencji seryjnej może spowodować migawki nieprawidłowa, i jeśli to przypadek wartość 1 daje uprawnienie dla Nowa migawka występują.

  • [ @ force_reinit_subscription = force_reinit_subscription
    Acknowledges that dropping the article requires existing subscriptions to be reinitialized.force_reinit_subscription is a bit, with a default of 0.

    0 określa upuszczanie artykuł nie powoduje subskrypcja do należy ponownie zainicjować.

    1 oznacza że upuszczanie artykuł powoduje istniejących subskrypcja należy ponownie zainicjować i daje uprawnienie dla ponownego zainicjowania subskrypcja występuje.

  • [ @ignore_merge_metadata= ] ignore_merge_metadata
    Tylko do użytku wewnętrznego.

Wartości kodów powrotnych

0 (sukces) lub 1 (błąd)

Uwagi

sp_dropmergearticle używane w replikacja scalająca.Więcej informacji o upuszczanie artykułów, zobacz Artykuły Dodawanie i usuwanie artykułów z istniejącej publikacji.

Wykonywanie sp_dropmergearticle odrzucanie artykuł z publikacja nie powoduje usunięcia obiektu z bazy danych publikacja lub odpowiedni obiekt z baza danych subskrypcja.Użyj DROP <object> ręcznie usunąć te obiekty, jeśli to konieczne.

Przykład

DECLARE @publication AS sysname;
DECLARE @table1 AS sysname;
DECLARE @table2 AS sysname;
DECLARE @table3 AS sysname;
DECLARE @salesschema AS sysname;
DECLARE @hrschema AS sysname;
DECLARE @filterclause AS nvarchar(1000);
SET @publication = N'AdvWorksSalesOrdersMerge'; 
SET @table1 = N'Employee'; 
SET @table2 = N'SalesOrderHeader'; 
SET @table3 = N'SalesOrderDetail'; 
SET @salesschema = N'Sales';
SET @hrschema = N'HumanResources';
SET @filterclause = N'Employee.LoginID = HOST_NAME()';

-- Drop the merge join filter between SalesOrderHeader and SalesOrderDetail.
EXEC sp_dropmergefilter 
  @publication = @publication, 
  @article = @table3, 
  @filtername = N'SalesOrderDetail_SalesOrderHeader', 
  @force_invalidate_snapshot = 1, 
  @force_reinit_subscription = 1;

-- Drops the merge join filter between Employee and SalesOrderHeader.
EXEC sp_dropmergefilter 
  @publication = @publication, 
  @article = @table2, 
  @filtername = N'SalesOrderHeader_Employee', 
  @force_invalidate_snapshot = 1, 
  @force_reinit_subscription = 1;

-- Drops the article for the SalesOrderDetail table.
EXEC sp_dropmergearticle 
  @publication = @publication, 
  @article = @table3,
  @force_invalidate_snapshot = 1, 
  @force_reinit_subscription = 1;

-- Drops the article for the SalesOrderHeader table.
EXEC sp_dropmergearticle 
  @publication = @publication, 
  @article = @table2, 
  @force_invalidate_snapshot = 1, 
  @force_reinit_subscription = 1;

-- Drops the article for the Employee table.
EXEC sp_dropmergearticle 
  @publication = @publication, 
  @article = @table1,
  @force_invalidate_snapshot = 1, 
  @force_reinit_subscription = 1;
GO

DECLARE @publication AS sysname;
DECLARE @article1 AS sysname;
DECLARE @article2 AS sysname;
SET @publication = N'AdvWorksSalesOrdersMerge';
SET @article1 = N'SalesOrderDetail'; 
SET @article2 = N'SalesOrderHeader'; 

-- Remove articles from a merge publication.
USE [AdventureWorks2008R2]
EXEC sp_dropmergearticle 
  @publication = @publication, 
  @article = @article1,
  @force_invalidate_snapshot = 1;
EXEC sp_dropmergearticle 
  @publication = @publication, 
  @article = @article2,
  @force_invalidate_snapshot = 1;
GO

Uprawnienia

Tylko członkowie sysadmin stała rola serwera lub db_owner ustaloną rola bazy danych można wykonać sp_dropmergearticle.