TransArticle Object

Questa funzionalità verrà rimossa in una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa funzionalità in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.

The TransArticle object represents a table or a stored procedure published using a transactional or a snapshot publication.

Modello di oggetti SQL-DMO in cui è visualizzato l'oggetto corrente

Properties

ArticleType Property

Name Property

CommandOptions Property

PreCreationMethod Property

CreationScriptOptions Property

ReplicateAllColumns Property

CreationScriptPath Property

ReplicationFilterProcName Property

DeleteCommand Property

ReplicationFilterProcOwner Property

DestinationObjectName Property

SnapshotObjectName Property

DestinationOwnerName Property

SnapshotObjectOwner Property

FilterClause Property

SourceObjectName Property

ID Property

SourceObjectOwner Property

InsertCommand Property

UpdateCommand Property

Methods

AddReplicatedColumns Method

Remove Method (Objects)

BeginAlter Method

RemoveReplicatedColumns Method

CancelAlter Method

Script Method (Replication Objects)

DoAlter Method

ScriptDestinationObject Method

ListReplicatedColumns Method

 

Osservazioni

With the TransArticle object, you can:

  • Add a table or stored procedure article to a transactional publication.
  • Change the properties of an existing table or stored procedure article of a transactional publication.
  • Add a table or stored procedure article to a snapshot publication.
  • Change the properties of an existing table or stored procedure article of a snapshot publication.

[!NOTA] The TransArticle object is compatible with instances of SQL Server versions 7.0 and later. However, the TransArticle2 object extends the functionality of the TransArticle object for use with features that were introduced in SQL Server 2000.

To add a table article to a transactional publication

  1. Create a new TransArticle object.

  2. Set the Name property to the name of the new article.

  3. Set the SourceObjectName property to the name of a table.

  4. Set the SourceObjectOwner property to the owner of the table.

  5. Add the TransArticle object to the TransArticles collection of a connected TransPublication object containing a transactional publication.

To add a stored procedure article to a transactional publication

  1. Create a new TransArticle object.

  2. Set the Name property to the name of the new article.

  3. Set the SourceObjectName property to the name of a stored procedure.

  4. Set the SourceObjectOwner property to the owner of the stored procedure.

  5. Set the ArticleType property to SQLDMORep_ProcExecution or SQLDMORep_SerializableProcExecution.

  6. Set the CreationScriptOptions property to SQLDMOCreationScript_PrimaryObject.

  7. Add the TransArticle object to the TransArticles collection of a connected TransPublication object containing a transactional publication.

To alter an existing table article of an existing transactional publication

  1. Get a TransArticle object containing a table article from the TransArticles collection of a connected TransPublication object.

  2. Use the BeginAlter method to mark the beginning of the changes.

  3. Set the TransArticle object properties to reflect the changes to the table article.

  4. Use the DoAlter method to submit the changes to Microsoft SQL Server.

To alter an existing stored procedure article of an existing transactional publication

  1. Get a TransArticle object containing a stored procedure article from the TransArticles collection of a connected TransPublication object.

  2. Use the BeginAlter method to mark the beginning of the changes.

  3. Set the TransArticle object properties to reflect the changes to the stored procedure article.

  4. Use the DoAlter method to submit the changes to SQL Server.

To add a table article to a snapshot publication

  1. Create a new TransArticle object.

  2. Set the Name property to the name of the new article.

  3. Set the SourceObjectName property to the name of a table.

  4. Set the SourceObjectOwner property to the owner of the table.

  5. Add the TransArticle object to the TransArticles collection of a connected TransPublication object containing a snapshot publication.

To add a stored procedure article to a snapshot publication

  1. Create a new TransArticle object.

  2. Set the Name property to the name of the new article.

  3. Set the SourceObjectName property to the name of a stored procedure.

  4. Set the SourceObjectOwner property to the owner of the stored procedure.

  5. Set the ArticleType property to SQLDMORep_ProcExecution or SQLDMORep_SerializableProcExecution.

  6. Add the TransArticle object to the TransArticles collection of a connected TransPublication object containing a snapshot publication.

To alter an existing table article of an existing snapshot publication

  1. Get a TransArticle object containing a table article from the TransArticles collection of a connected TransPublication object containing a snapshot publication.

  2. Use the BeginAlter method to mark the beginning of the changes.

  3. Set the TransArticle object properties to reflect the changes to the table article.

  4. Use the DoAlter method to submit the changes to SQL Server.

To alter an existing stored procedure article of an existing snapshot publication

  1. Get a TransArticle object containing a stored procedure article from the TransArticles collection of a connected TransPublication object containing a snapshot publication.

  2. Use the BeginAlter method to mark the beginning of the changes.

  3. Set the TransArticle object properties to reflect the changes to the stored procedure article.

  4. Use the DoAlter method to submit the changes to SQL Server.

Vedere anche

Riferimento

TransArticle2 Object

Guida in linea e informazioni

Assistenza su SQL Server 2005