ServerConnection.CommitTransaction 方法
認可參考連接上目前的交易。
命名空間: Microsoft.SqlServer.Management.Common
組件: Microsoft.SqlServer.ConnectionInfo (在 Microsoft.SqlServer.ConnectionInfo.dll 中)
語法
'宣告
Public Sub CommitTransaction
'用途
Dim instance As ServerConnection
instance.CommitTransaction()
public void CommitTransaction()
public:
void CommitTransaction()
member CommitTransaction : unit -> unit
public function CommitTransaction()
範例
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()
請參閱
參考
Microsoft.SqlServer.Management.Common 命名空間