Share via


TransPublication Constructors

Definition

Creates a new instance of the TransPublication class.

Overloads

TransPublication()

Creates a new instance of the TransPublication class.

TransPublication(String, String, ServerConnection)

Creates a new instance of the TransPublication class with the required properties.

TransPublication(String, String, ServerConnection, Boolean)

Creates a new instance of the TransPublication class with the required properties, and indicates whether the Snapshot Agent job for the publication is created.

Remarks

Updated text: 17 July 2006

The following table shows the default property values for a new instance of TransPublication. Any properties that are not explicitly enumerated in this table are initialized to a null value.

Property Default value
Attributes Values of AllowPush and SnapshotInDefaultFolder for

PublicationAttributes
CachePropertyChanges false
ConflictPolicy A value of PublisherWin for ConflictPolicyOption
ConflictRetention 14 (days)
ContinueOnConflict false
CreateSnapshotAgentByDefault false
FtpPort 1 21
HasSubscription false
IsExistingObject false
QueueType A value of Sql for QueueOption
ReplicateDdl A value of All for DdlReplicationOptions
RetentionPeriod 0 (never expires)
SnapshotAgentExists false
SnapshotAvailable false
SnapshotGenerationAgentPublisherSecurity A value of true for WindowsAuthentication
SnapshotMethod A value of BcpNative for InitialSyncType
SnapshotSchedule A value of 99991231 for ActiveEndDate

A value of 235959 for ActiveEndTime

A value of 0 for ActiveStartDate

A value of 0 for ActiveStartTime

A value of 1 for FrequencyInterval

A value of 0 for FrequencyRecurrenceFactor

A value of First for FrequencyRelativeInterval

A value of Hour for FrequencySubDay

A value of 1 for FrequencySubDayInterval

A value of Daily for FrequencyType
Status A value of Active for State
Type A value of Transactional for PublicationType

1 The FTP (file transfer protocol) port is used only if you transfer snapshots by using FTP. For more information, see Transfer Snapshots Through FTP.

TransPublication()

Creates a new instance of the TransPublication class.

public:
 TransPublication();
public TransPublication ();
Public Sub New ()

Applies to

TransPublication(String, String, ServerConnection)

Creates a new instance of the TransPublication class with the required properties.

public:
 TransPublication(System::String ^ name, System::String ^ databaseName, Microsoft::SqlServer::Management::Common::ServerConnection ^ connectionContext);
public TransPublication (string name, string databaseName, Microsoft.SqlServer.Management.Common.ServerConnection connectionContext);
new Microsoft.SqlServer.Replication.TransPublication : string * string * Microsoft.SqlServer.Management.Common.ServerConnection -> Microsoft.SqlServer.Replication.TransPublication
Public Sub New (name As String, databaseName As String, connectionContext As ServerConnection)

Parameters

name
String

A String value that specifies the name of publication.

databaseName
String

A String value that specifies the name of the publication database.

connectionContext
ServerConnection

A ServerConnection object that represents a connection to the Publisher or to the Distributor for a non-SQL Server Publisher.

Applies to

TransPublication(String, String, ServerConnection, Boolean)

Creates a new instance of the TransPublication class with the required properties, and indicates whether the Snapshot Agent job for the publication is created.

public:
 TransPublication(System::String ^ name, System::String ^ databaseName, Microsoft::SqlServer::Management::Common::ServerConnection ^ connectionContext, bool createSnapshotAgentByDefault);
public TransPublication (string name, string databaseName, Microsoft.SqlServer.Management.Common.ServerConnection connectionContext, bool createSnapshotAgentByDefault);
new Microsoft.SqlServer.Replication.TransPublication : string * string * Microsoft.SqlServer.Management.Common.ServerConnection * bool -> Microsoft.SqlServer.Replication.TransPublication
Public Sub New (name As String, databaseName As String, connectionContext As ServerConnection, createSnapshotAgentByDefault As Boolean)

Parameters

name
String

A String value that specifies the name of publication.

databaseName
String

A String value that specifies the name of the publication database.

connectionContext
ServerConnection

A ServerConnection object that represents a connection to the Publisher or to the Distributor for a non-SQL Server Publisher.

createSnapshotAgentByDefault
Boolean

A Boolean value that indicates whether the Snapshot Agent job is added automatically when the publication is created.

Applies to