Метод ServerConnection.BeginTransaction
Starts a transaction on the referenced connection.
Пространство имен: Microsoft.SqlServer.Management.Common
Сборка: Microsoft.SqlServer.ConnectionInfo (в Microsoft.SqlServer.ConnectionInfo.dll)
Синтаксис
'Декларация
Public Sub BeginTransaction
'Применение
Dim instance As ServerConnection
instance.BeginTransaction()
public void BeginTransaction()
public:
void BeginTransaction()
member BeginTransaction : unit -> unit
public function BeginTransaction()
Примеры
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