ServerConnection.IsInFixedServerRole 메서드

참조된 연결과 관련된 로그온이 지정한 고정 서버 역할의 멤버인지 여부를 테스트합니다.

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

구문

‘선언
Public Function IsInFixedServerRole ( _
    fixedServerRole As FixedServerRoles _
) As Boolean
‘사용 방법
Dim instance As ServerConnection 
Dim fixedServerRole As FixedServerRoles 
Dim returnValue As Boolean 

returnValue = instance.IsInFixedServerRole(fixedServerRole)
public bool IsInFixedServerRole(
    FixedServerRoles fixedServerRole
)
public:
bool IsInFixedServerRole(
    FixedServerRoles fixedServerRole
)
member IsInFixedServerRole : 
        fixedServerRole:FixedServerRoles -> bool
public function IsInFixedServerRole(
    fixedServerRole : FixedServerRoles
) : boolean

매개 변수

반환 값

유형: Boolean
로그온이 지정한 고정 서버 역할의 멤버인지 여부를 지정하는 Boolean 값입니다.True이면 로그온이 지정한 고정 서버 역할의 멤버입니다.False이면 로그온이 지정한 고정 서버 역할의 멤버가 아닙니다.

C#

ServerConnection conn = new ServerConnection();
conn.DatabaseName = "AdventureWorks2012";
Console.WriteLine(conn.IsInFixedServerRole(FixedServerRoles.SysAdmin));

PowerShell

$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
$conn.DatabaseName = "AdventureWorks2012"
Write-Host $conn.IsInFixedServerRole([Microsoft.SqlServer.Management.Common.FixedServerRoles]::SysAdmin)

참고 항목

참조

ServerConnection 클래스

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

관련 자료

Permissions of Fixed Server Roles