Article.Name Article.Name Article.Name Property

정의

아티클 이름을 가져오거나 설정합니다. Gets or sets the name of the article.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
Public Property Name As String
속성 값

아티클의 이름입니다. The name of the article.

예외

기존 아티클에 대 한이 속성을 설정 하면 됩니다. When you set this property for an existing article.

설정한 경우이 속성 값으로 하는 null, 포함 null 문자 또는 유니코드 128 자 보다 깁니다. When you set this property to a value that is null, contains null characters, or is longer than 128-Unicode characters.

예제

// 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();
}
' Define the Publisher, publication, and article names.
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksProductTran"
Dim publicationDbName As String = "AdventureWorks2012"
Dim articleName As String = "Product"
Dim schemaOwner As String = "Production"

Dim article As TransArticle

' Create a connection to the Publisher.
Dim conn As ServerConnection = 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 = article.SchemaOption Or _
    CreationScriptOptions.Schema

    If Not article.IsExistingObject Then
        ' Create the article.
        article.Create()
    Else
        Throw New ApplicationException(String.Format( _
         "The article {0} already exists in publication {1}.", _
         articleName, publicationName))
    End If

    ' Create an array of column names to remove from the article.
    Dim columns() As String = New String(0) {}
    columns(0) = "DaysToManufacture"

    ' Remove the column from the article.
    article.RemoveReplicatedColumns(columns)
Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("The article could not be created.", ex)
Finally
    conn.Disconnect()
End Try

설명

Name 속성을 호출 하기 전에 설정 해야 Create 는 서버에 문서를 만들 수 있습니다.The Name property must be set before calling Create to create the article on the server. 문서는 서버에 있는 되 면이 속성을 설정할 수 없습니다.Once the article exists on the server, this property cannot be set.

Name 의 멤버 속성을 검색할 수는 sysadmin 게시자 및 구독자 (재게시 구독자)에서 고정된 서버 역할입니다.The Name property can be retrieved by members of the sysadmin fixed server role at the Publisher and at the Subscriber (for republishing Subscribers). 멤버에 의해 검색할 수도 있습니다는 db_owner PAL의 구성원 인 사용자와 게시 데이터베이스에서 고정된 데이터베이스 역할입니다.It can also be retrieved by members of the db_owner fixed database role on the publication database and by users who are members of the PAL. 에 대 한는 MergeArticle 개체의 멤버에 의해이 속성을 검색할 수도 있습니다는 replmonitor 배포자에 대 한 고정된 데이터베이스 역할.For a MergeArticle object, this property can also be retrieved by members of the replmonitor fixed database role on the Distributor.

Name 속성의 멤버는 sysadmin 게시자에서 고정된 서버 역할입니다.The Name property can be set by members of the sysadmin fixed server role at the Publisher. 멤버에 의해 설정할 수도 있습니다는 db_owner 게시 데이터베이스의 고정된 데이터베이스 역할입니다.It can also be set by members of the db_owner fixed database role on the publication database.

검색 Name 를 실행 하는 것과 같습니다 sp_helparticle (Transact SQL) 트랜잭션 또는 스냅숏 복제 또는 실행에 대 한 sp_helpmergearticle (Transact SQL) 병합에 대 한 복제 합니다.Retrieving Name is equivalent to executing sp_helparticle (Transact-SQL) for transactional or snapshot replication or executing sp_helpmergearticle (Transact-SQL) for merge replication.

설정 Name 를 실행 하는 것과 같습니다 sp_addarticle (Transact SQL) 트랜잭션 또는 스냅숏 복제 또는 실행에 대 한 sp_addmergearticle (Transact SQL) 병합에 대 한 복제 합니다.Setting Name is equivalent to executing sp_addarticle (Transact-SQL) for transactional or snapshot replication or executing sp_addmergearticle (Transact-SQL) for merge replication.

Name 속성은 읽기/쓰기 속성입니다.The Name property is a read/write property.

적용 대상