Table of Contents

TL;DR

在select視窗下

輸入

EXECUTE AS login=SUSER_SNAME();
SELECT* FROM fn_my_permissions(null,'database')
ORDER BY subentity_name, permission_name ;
REVERT;
go

Syntax

-- 指定查自己正在登入的帳號

execute as login=SUSER_SNAME();

-- 查詢 fn_my_permissions 資料表,括弧內分別代表( securable , 'securable_class' ),這裡設定(null,'database')

select * from fn_my_permissions(null,'database')
ORDER BY subentity_name, permission_name ;

-- 呼應 execute as 架構後執行

REVERT;
go