다음을 통해 공유


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()

참고 항목

참조

ServerConnection 클래스

Microsoft.SqlServer.Management.Common 네임스페이스

관련 자료

트랜잭션 사용