3

Learning sql server over here and I'm trying to figure out how to see the securable permissions I have added via T-SQL , in SSMS

For example, I have a database user called "LoginUser1" in Database1 and I granted "grant create table, create view to LoginUser1".

I'm trying to see this permission in SSMS. I go to the properties for the user in this database but i'm not seeing anything. What am I missing? Thanks!

cspell
  • 501
  • 7
  • 17

2 Answers2

5

Query presented by @S4V1N will do the trick. If you have to see it via GUI using SSMS you can select:

Database → Properties → Permissions → Select the user LoginUser1 from Users or roles: list.

Select Explicit, you will see this.

enter image description here

Select Effective, you will see this.

enter image description here

Evan Carroll
  • 63,051
  • 46
  • 242
  • 479
SqlWorldWide
  • 13,153
  • 3
  • 28
  • 52
3

You can try this :

SELECT
   ISNULL(OBJECT_NAME(major_id),'') [Objects], USER_NAME(grantee_principal_id) as [UserName], permission_name as [PermissionName]
FROM
    sys.database_permissions p
WHERE grantee_principal_id>0
ORDER BY
    OBJECT_NAME(major_id), USER_NAME(grantee_principal_id), permission_name
S4V1N
  • 1,064
  • 6
  • 12