SubscriptionChronicle.SqlStatements Property

Gets the collection of Transact-SQL statements that create the subscription chronicle.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public ReadOnly Property SqlStatements As StringCollection
public StringCollection SqlStatements { get; }
public:
property StringCollection^ SqlStatements {
    StringCollection^ get ();
}
/** @property */
public StringCollection get_SqlStatements ()
public function get SqlStatements () : StringCollection

Eigenschaftswert

A StringCollection containing the Transact-SQL statement strings.

Hinweise

Use the StringCollection methods to add or modify the statements that create the subscription chronicle.

When using a subscription chronicle, you should drop or rename the chronicle table if it already exists and then create the chronicle table. If you do not drop or rename an existing chronicle table, you receive an "object exists" error when you update the application.

Beispiel

The following examples show how to create a subscription chronicle:

// Define a chronicle for the subscription class
SubscriptionChronicle sc1 = new SubscriptionChronicle(
    flightSubscriptions, "FlightSubChronicle");
sc1.SqlStatements.Add(
    "CREATE TABLE MyAppSchema.FlightSubChronicle " + 
    " (SubscriptionId bigint, LeavingFrom nvarchar(6), " + 
    "  GoingTo nvarchar(6), Price float);");
sc1.SqlStatements.Add(
    "CREATE INDEX FlightSubChronicleIndex  " +
    " ON MyAppSchema.FlightSubChronicle " +
    " ( LeavingFrom, GoingTo );");
flightSubscriptions.SubscriptionChronicles.Add(sc1);
' Define a chronicle for the subscription class
Dim sc1 As SubscriptionChronicle = New SubscriptionChronicle( _
    flightSubscriptions, "FlightSubChronicle")
sc1.SqlStatements.Add( _
    "CREATE TABLE MyAppSchema.FlightSubChronicle " + _
    "(SubscriptionId bigint, LeavingFrom nvarchar(6), " + _
    "GoingTo nvarchar(6), Price float);")
sc1.SqlStatements.Add( _
    "CREATE INDEX FlightSubChronicleIndex  " + _
    "ON MyAppSchema.FlightSubChronicle " + _
    "( LeavingFrom, GoingTo );")
flightSubscriptions.SubscriptionChronicles.Add(sc1)

Threadsicherheit

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

Plattformen

Entwicklungsplattformen

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Zielplattforme

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Siehe auch

Verweis

SubscriptionChronicle Class
SubscriptionChronicle Members
Microsoft.SqlServer.Management.Nmo Namespace

Andere Ressourcen

Definieren von Verläufen für eine Abonnementklasse
SqlSchema Element for SubscriptionClass/Chronicles/Chronicle (ADF)