Condividi tramite


Metodo ServerConnection.CommitTransaction

Commits the current transaction on the referenced connection.

Spazio dei nomi  Microsoft.SqlServer.Management.Common
Assembly:  Microsoft.SqlServer.ConnectionInfo (in Microsoft.SqlServer.ConnectionInfo.dll)

Sintassi

'Dichiarazione
Public Sub CommitTransaction
'Utilizzo
Dim instance As ServerConnection

instance.CommitTransaction()
public void CommitTransaction()
public:
void CommitTransaction()
member CommitTransaction : unit -> unit
public function CommitTransaction()

Esempi

C#

ServerConnection conn = new ServerConnection();
conn.DatabaseName = "AdventureWorks2012";
conn.BeginTransaction();
conn.ExecuteNonQuery("CREATE TABLE TABLE1(d int, name varchar(32));")
conn.CommitTransaction();

PowerShell

$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
$conn.DatabaseName = "AdventureWorks2012"
$conn.BeginTransaction()
$conn.ExecuteNonQuery("CREATE TABLE TABLE1(d int,name varchar(32));")
$conn.CommitTransaction()

Vedere anche

Riferimento

ServerConnection Classe

Spazio dei nomi Microsoft.SqlServer.Management.Common

Altre risorse

Utilizzo di transazioni