문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Server.GetActiveDBConnectionCount 메서드

Returns the number of active connections for the specified database.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

public int GetActiveDBConnectionCount(
	string dbName
)

매개 변수

dbName
유형: System.String
A String value that specifies the name of the database.

반환 값

유형: System.Int32
An Int32 value that specifies the number of active connections for the specified database.

This method returns the number of active connections to a database. By iterating through all the databases on the instance of SQL Server, you can determine the total number of connections to databases on the instance of SQL Server.

Visual Basic

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server()

'Display the number active connections to the database.
Console.WriteLine(srv.GetActiveDBConnectionCount("AdventureWorks2012"))

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")

Write-Host $srv.GetActiveDBConnectionCount("AdventureWorks2012")

커뮤니티 추가 항목

추가
표시: