Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TransArticle Class

 

Applies To: SQL Server 2016 Preview

Represents an article in a transactional publication.

Namespace:   Microsoft.SqlServer.Replication
Assembly:  Microsoft.SqlServer.Rmo (in Microsoft.SqlServer.Rmo.dll)


public sealed class TransArticle : Article

NameDescription
System_CAPS_pubmethodTransArticle()

Creates a new instance of the TransArticle class.

System_CAPS_pubmethodTransArticle(String, String, String, ServerConnection)

Creates a new instance of the TransArticle class, with the required properties and with the specified connection to the instance of Microsoft SQL Server.

NameDescription
System_CAPS_pubpropertyArticleId

Gets the article ID value.(Inherited from Article.)

System_CAPS_pubpropertyArticleLogTablespace

Gets or sets the name of the Oracle tablespace used to store replication log information.

System_CAPS_pubpropertyCachePropertyChanges

Gets or sets whether to cache changes made to the replication properties or to apply them immediately.(Inherited from ReplicationObject.)

System_CAPS_pubpropertyCommandFormat

Gets or sets how changes are propagated for the article.

System_CAPS_pubpropertyConnectionContext

Gets or sets the connection to an instance of Microsoft SQL Server.(Inherited from ReplicationObject.)

System_CAPS_pubpropertyCreationScript

Gets or sets the name and full path of the Transact-SQL script file that is used to create the destination object at the Subscriber.(Inherited from Article.)

System_CAPS_pubpropertyDatabaseName

Gets or sets the name of the database that contains the data and the objects that are published in the article.(Inherited from Article.)

System_CAPS_pubpropertyDatatypeMappingOptions

Returns whether the default article data type mapping is used for a non-SQL Server Publisher.

System_CAPS_pubpropertyDeleteCommand

Gets or sets the command used to replicate deletes.

System_CAPS_pubpropertyDescription

Gets or sets a textual description of the article.(Inherited from Article.)

System_CAPS_pubpropertyDestinationObjectName

Gets or sets the database object that is the source database object for the article at the Subscriber.(Inherited from Article.)

System_CAPS_pubpropertyDestinationObjectOwner

Gets or sets the schema owner of the source database object for the article at the Subscriber.(Inherited from Article.)

System_CAPS_pubpropertyFilterClause

Gets or sets the WHERE clause used to filter the article horizontally.

System_CAPS_pubpropertyFilterProcName

Gets or sets the stored procedure (created with FOR REPLICATION) used to filter the table horizontally.

System_CAPS_pubpropertyFilterProcOwner

Gets or sets the database user who owns the stored procedure that is used to horizontally partition a table-based article.

System_CAPS_pubpropertyIdentityRangeManagementOption

Gets or sets the identity range management options for the article.(Inherited from Article.)

System_CAPS_pubpropertyIdentityRangeThreshold

Gets or sets the value at which a new range of identity column values are assigned to a Publisher or to a Subscriber.(Inherited from Article.)

System_CAPS_pubpropertyInsertCommand

Gets or sets the command used to replicate inserts.

System_CAPS_pubpropertyIsExistingObject

Gets whether the object exists on the server or not.(Inherited from ReplicationObject.)

System_CAPS_pubpropertyName

Gets or sets the name of the article.(Inherited from Article.)

System_CAPS_pubpropertyPreCreationMethod

Gets or sets the action to take when the published object already exists in the subscription database.(Inherited from Article.)

System_CAPS_pubpropertyPublicationName

Gets or sets the name of the publication to which the article belongs.(Inherited from Article.)

System_CAPS_pubpropertyPublisherIdentityRangeSize

For a TransArticle object, gets or sets the range of identity values assigned to table columns at the Publisher. For a MergeArticle object, gets or sets the range of identity values assigned to table columns at Subscribers that have server subscriptions.(Inherited from Article.)

System_CAPS_pubpropertyPublisherName

Gets or sets the name of the non-SQL Server Publisher that publishes the article.

System_CAPS_pubpropertySchemaOption

Gets or sets the schema creation options for an article.(Inherited from Article.)

System_CAPS_pubpropertySnapshotObjectName

Gets or sets the database object that provides the initial data snapshot for the article.

System_CAPS_pubpropertySnapshotObjectOwner

Gets or sets the owner of the database object that provides the initial data snapshot for the article.

System_CAPS_pubpropertySourceObjectName

Gets or sets the name of the database object that is being published.(Inherited from Article.)

System_CAPS_pubpropertySourceObjectOwner

Gets or sets the owner of the database object that is being published.(Inherited from Article.)

System_CAPS_pubpropertySqlServerName

Gets the name of the Microsoft SQL Server instance to which this object is connected. (Inherited from ReplicationObject.)

System_CAPS_pubpropertySubscriberIdentityRangeSize

Gets or sets the maximum number of new rows that can be inserted into an identity column in a table at a Subscriber before another identity range must be allocated.(Inherited from Article.)

System_CAPS_pubpropertyType

Gets or sets the type of article.(Inherited from Article.)

System_CAPS_pubpropertyUpdateCommand

Gets or sets the command used to replicate updates.

System_CAPS_pubpropertyUserData

Gets or sets an object property that allows users to attach their own data to the object. (Inherited from ReplicationObject.)

System_CAPS_pubpropertyVerticalPartition

Gets a value that indicates whether all columns are published in a table article.(Inherited from Article.)

NameDescription
System_CAPS_pubmethodAddReplicatedColumns(Array)

Includes columns in a vertically partitioned table article.

System_CAPS_pubmethodCommitPropertyChanges()

Sends all the cached property change statements to the instance of Microsoft SQL Server.(Inherited from ReplicationObject.)

System_CAPS_pubmethodCreate()

Creates a new article on the currently connected instance of SQL Server based on the current properties of the TransArticle object or the MergeArticle object.(Inherited from Article.)

System_CAPS_pubmethodDecouple()

Decouples the referenced replication object from the server. (Inherited from ReplicationObject.)

System_CAPS_pubmethodEnumHeterogeneousColumns()

Returns column information for a table article published by a non-SQL Server Publisher.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodListReplicatedColumns()

Returns the published columns in a table article.

System_CAPS_pubmethodLoad()

Loads the properties of an existing object from the server. (Inherited from ReplicationObject.)

System_CAPS_pubmethodLoadProperties()

Loads the properties of an existing object from the server. (Inherited from ReplicationObject.)

System_CAPS_pubmethodRefresh()

Reloads the properties of the object. (Inherited from ReplicationObject.)

System_CAPS_pubmethodRemove()

Removes an existing article on the currently connected instance of SQL Server based on the current properties of the TransArticle object or the MergeArticle object.(Inherited from Article.)

System_CAPS_pubmethodRemoveReplicatedColumns(Array)

Excludes columns from a vertically partitioned table article.

System_CAPS_pubmethodScript(ScriptOptions)

Generates a Transact-SQL script that can be executed to create or delete the TransArticle object or the MergeArticle object on the server.(Inherited from Article.)

System_CAPS_pubmethodScriptChangeColumnDestinationDataType(String, String, Int64, Int32, Int64, ScriptOptions)

Returns a Transact-SQL script used to change the column data type mapping for a non-SQL Server Publisher. 

System_CAPS_pubmethodSetColumnDestinationDataType(String, String, Int64, Int32, Int64)

Sets the column data type mapping for a non-SQL Server Publisher.

System_CAPS_pubmethodToString()

(Inherited from Object.)

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Legacy Code Example

			// Define the Publisher, publication, and article names.
			string publisherName = publisherInstance;
			string publicationName = "AdvWorksProductTran";
			string publicationDbName = "AdventureWorks2012";
			string articleName = "Product";
			string schemaOwner = "Production";

			TransArticle article;

			// Create a connection to the Publisher.
			ServerConnection conn = new ServerConnection(publisherName);

			// Create a filtered transactional articles in the following steps:
			// 1) Create the  article with a horizontal filter clause.
			// 2) Add columns to or remove columns from the article.
			try
			{
				// Connect to the Publisher.
				conn.Connect();

				// Define a horizontally filtered, log-based table article.
				article = new TransArticle();
				article.ConnectionContext = conn;
				article.Name = articleName;
				article.DatabaseName = publicationDbName;
				article.SourceObjectName = articleName;
				article.SourceObjectOwner = schemaOwner;
				article.PublicationName = publicationName;
				article.Type = ArticleOptions.LogBased;
				article.FilterClause = "DiscontinuedDate IS NULL";

				// Ensure that we create the schema owner at the Subscriber.
				article.SchemaOption |= CreationScriptOptions.Schema;

				if (!article.IsExistingObject)
				{
					// Create the article.
					article.Create();
				}
				else
				{
					throw new ApplicationException(String.Format(
						"The article {0} already exists in publication {1}.",
						articleName, publicationName));
				}

				// Create an array of column names to remove from the article.
				String[] columns = new String[1];
				columns[0] = "DaysToManufacture";

				// Remove the column from the article.
				article.RemoveReplicatedColumns(columns);
			}
			catch (Exception ex)
			{
				// Implement appropriate error handling here.
				throw new ApplicationException("The article could not be created.", ex);
			}
			finally
			{
				conn.Disconnect();
			}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Community Additions

Show:
© 2015 Microsoft