Database.ActiveConnections Database.ActiveConnections Database.ActiveConnections Property

정의

데이터베이스에 대한 활성 연결의 수를 가져옵니다. Gets the number of active connections to the database.

public:
 property int ActiveConnections { int get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcProperty(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Expensive | Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Standalone)]
public int ActiveConnections { get; }
Public ReadOnly Property ActiveConnections As Integer
속성 값

데이터베이스의 활성 연결 수를 지정하는 Int32 값입니다. An Int32 value that specifies the number of active connections to the database.

예제

VBVB

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

'Reference the AdventureWorks2012 database.  
Dim db As Database  
db = srv.Databases("AdventureWorks2012")  

'Display the number of active connections to the database.  
Console.WriteLine(db.ActiveConnections)  

PowerShellPowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$db = New-Object Microsoft.SqlServer.Management.Smo.Database  
$db = $srv.Databases.Item("AdventureWorks2012")  
Write-Host $db.ActiveConnections  

설명

ActiveConnections 속성은 참조된 데이터베이스의 활성 연결 수를 반환합니다.The ActiveConnections property returns the active connections for the referenced database. GetActiveDBConnectionCount 메서드를 사용하여 SQL Server 인스턴스의 총 데이터베이스 연결 수를 반환하십시오.Use the GetActiveDBConnectionCount method to return the total database connections on the instance of SQL Server.

적용 대상

추가 정보