Méthode RollBackTransaction
Rolls back the current transaction.
Espace de noms : Microsoft.SqlServer.Management.Common
Assembly : Microsoft.SqlServer.ConnectionInfo (en Microsoft.SqlServer.ConnectionInfo.dll)
Syntaxe
'Déclaration
Public Sub RollBackTransaction
'Utilisation
Dim instance As ServerConnection
instance.RollBackTransaction()
public void RollBackTransaction()
public:
void RollBackTransaction()
member RollBackTransaction : unit -> unit
public function RollBackTransaction()
Exemples
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