GetTransactionCount 메서드 (TransactionTypes)
데이터베이스에 대해 지정한 유형의 열린 트랜잭션 수를 가져옵니다.
네임스페이스: Microsoft.SqlServer.Management.Smo
어셈블리: Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)
구문
‘선언
Public Function GetTransactionCount ( _
transactionType As TransactionTypes _
) As Integer
‘사용 방법
Dim instance As Database
Dim transactionType As TransactionTypes
Dim returnValue As Integer
returnValue = instance.GetTransactionCount(transactionType)
public int GetTransactionCount(
TransactionTypes transactionType
)
public:
int GetTransactionCount(
TransactionTypes transactionType
)
member GetTransactionCount :
transactionType:TransactionTypes -> int
public function GetTransactionCount(
transactionType : TransactionTypes
) : int
매개 변수
- transactionType
유형: Microsoft.SqlServer.Management.Smo. . :: . .TransactionTypes
반환되는 개수를 제한할 트랜잭션 유형을 지정하는 TransactionTypes 개체 값입니다.
반환 값
유형: System. . :: . .Int32
지정한 형식의 데이터베이스에 대해 열린 트랜잭션 수를 지정하는 Int32 값입니다.
주의
You can use this method to determine how many transactions of a specific type are open on the database.
예
VB
'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Reference the AdventureWorks2008R2 database.
Dim db As Database
db = srv.Databases("AdventureWorks2008R2")
'Display the number of open transaction on the database.
Console.WriteLine(db.GetTransactionCount.ToString)
PowerShell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")
Write-Host $db.GetTransactionCount()