System table master.dbo.sysprotects

When a server-wide privilege such as own database is granted on a database, the permission is recorded in master.dbo.sysprotects, with the database ID (dbid) stored in the ID field.

All grantable permission values are stored in master.dbo.spt_values. The columns in spt_values are overloaded as:

Table 8-14: master.dbo.spt_values

Parameter

Value

name

Permission name string.

number

Internal token number of the permission (sysprotects.action).

type

Identifier for permission entries:

T – permissions available and grantable in releases prior to 15.7 ESD #1 and earlier and continue to be available and grantable in 15.7 ESD #2 and later whether the granular permissions option is on or off.

GP – permissions only available and grantable when granular permissions option is on.

ansi_w

Execution scope of the permission:

1 – server-wide

2 – database-wide

4 – object

low

Adaptive Server version in which the permission is first introduced:

0 – exist in versions earlier than 15.7 ESD #2.

157002 – introduced in 15.7 ESD #2.

high

Token number of the permission that manages the current permission when granular permissions option is on:

117 – manage server permissions

114 – manage security permissions

106 – manage database permissions

97 – manage any object permission

msgnum

Bitset of the permission token:

  • 0x00000001   server-wide privilege

  • 0x00000002  database-wide privilege

  • 0x00000004  object permission

  • 0x00000008  when granting the privilege a database name is required

  • 0x00000010  the privilege is managed by "manage server permissions"

  • 0x00000020  the privilege is managed by "manage security permissions"

  • 0x00000040  the privilege is managed by "manage database permissions"

  • 0x00000080  column level permission

  • 0x00000100  the permission applies to system table object

  • 0x00000200  the permission applies to view object

  • 0x00000400  the permission applies to user table object

  • 0x00000800  the permission applies to procedure object