ServerConnection.RollBackTransaction メソッド
現在のトランザクションをロールバックします。
名前空間: Microsoft.SqlServer.Management.Common
アセンブリ: Microsoft.SqlServer.ConnectionInfo (Microsoft.SqlServer.ConnectionInfo.dll)
構文
'宣言
Public Sub RollBackTransaction
'使用
Dim instance As ServerConnection
instance.RollBackTransaction()
public void RollBackTransaction()
public:
void RollBackTransaction()
member RollBackTransaction : unit -> unit
public function RollBackTransaction()
使用例
C#
ServerConnection conn = new ServerConnection();
conn.DatabaseName = "AdventureWorks2012";
conn.BeginTransaction();
conn.ExecuteNonQuery("CREATE TABLE TABLE1(d int, name varchar(32));")
conn.RollBackTransaction();
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.RollBackTransaction()
関連項目