Метод RollBackTransaction
Rolls back the current transaction.
Пространство имен: 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 = "AdventureWorks2008R2";
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 = "AdventureWorks2008R2"
$conn.BeginTransaction()
$conn.ExecuteNonQuery("CREATE TABLE TABLE1(d int,name varchar(32));")
$conn.RollBackTransaction()
See Also