ADHOCQUERYFOLDERDEFAULTQUERYROLE

Stores the default roles for a folder's queries.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
GRANTORDENY bit Default = 0 1 if Granted, 0 if Denied
PERMISSIONTYPECODE tinyint Default = 0 0=Run, 1=Edit, 2=RunSmartQuery
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
PERMISSIONTYPE nvarchar(13) (Computed) yes CASE [PERMISSIONTYPECODE] WHEN 0 THEN N'Run' WHEN 1 THEN N'Edit' WHEN 2 THEN N'RunSmartQuery' END Provides a translation for the 'PERMISSIONTYPECODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
SYSTEMROLEID uniqueidentifier SYSTEMROLE.ID The system role ID for which the permission is set
ADHOCQUERYFOLDERID uniqueidentifier ADHOCQUERYFOLDER.ID The ad-hoc query for which the permission is set
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_ADHOCQUERYFOLDERDEFAULTQUERYROLE_DATEADDED DATEADDED yes
IX_ADHOCQUERYFOLDERDEFAULTQUERYROLE_DATECHANGED DATECHANGED
PK_ADHOCQUERYFOLDERDEFAULTQUERYROLE ID yes yes
UIX_ADHOCQUERYFOLDERDEFAULTQUERYROLE_SYSTEMROLEID_ADHOCQUERYFOLDERID_PERMISSIONTYPECODE SYSTEMROLEID, ADHOCQUERYFOLDERID, PERMISSIONTYPECODE yes

Triggers

Trigger Name Description
TR_ADHOCQUERYFOLDERDEFAULTQUERYROLE_AUDIT_UPDATE
TR_ADHOCQUERYFOLDERDEFAULTQUERYROLE_AUDIT_DELETE