Skip to main content

Core Data Collection Tables

SA_SQLServer_Instances

Description: Root entity table. Stores one row per discovered SQL Server instance (including Azure SQL). All other data collection tables reference back to an instance.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYAuto-incrementing surrogate primary key
namenvarchar128NoFully qualified SQL Server instance name (e.g., SERVER\INSTANCE)
sql_instance_idintYesFK reference to the shared SA_SQL_Instances table for cross-module linkage

Primary Key: PK_SA_SQLServer_Instances on id

Unique Constraints: UQ_SA_SQLServer_Instances_Name on name

Foreign Keys: None (root table)


SA_SQLServer_Databases

Description: Stores one row per database discovered on each SQL Server instance. Supports soft-delete via sa_delete_date to track removed databases.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYAuto-incrementing surrogate primary key
instance_idintNoFKReference to SA_SQLServer_Instances.id
database_idintYesNative SQL Server database_id from sys.databases
namenvarchar128NoDatabase name
create_datedatetimeYesDatabase creation timestamp
sa_delete_datedatetime2YesTimestamp when NAA detected the database was deleted; NULL while active

Primary Key: PK_SA_SQLServer_Databases on id

Unique Constraints: UQ_SA_SQLServer_Databases on (instance_id, database_id, name, create_date, sa_delete_date)

Indexes: SA_SQLServer_Databases_name_IDX on name (nonclustered)

Extended Properties: instance_id — "ref to SA_SQLServer_Instances.id"


SA_SQLServer_EventDatabases

Description: Lightweight database reference used by the audit event subsystem. Decoupled from SA_SQLServer_Databases to avoid blocking event ingestion when databases are being scanned/deleted.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoReference to the hosting SQL Server instance
active_database_idintYesFKFK to SA_SQLServer_Databases.id; links to the currently active database record
namenvarchar128NoDatabase name as recorded in audit events
minimum_event_datetimedatetime2YesEarliest event timestamp recorded for this database

Primary Key: PK_SA_SQLServer_EventDatabases on id

Unique Constraints: UQ_SA_SQLServer_EventDatabases on (instance_id, name)

Foreign Keys:

  • FK_SA_SQLServer_Active_Database_IdSA_SQLServer_Databases.id

Indexes: SA_SQLServer_EventDatabases_name_IDX on name (nonclustered)


SA_SQLServer_Schemas

Description: Stores database schemas discovered on target SQL Server instances. Maps the sys.schemas catalog view.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
database_idintNoReference to SA_SQLServer_Databases.id
schema_idintNoNative SQL Server schema_id
namenvarchar128YesSchema name (e.g., dbo, Sales)
database_principalintYesOwning principal ID within the database

Primary Key: PK_SA_SQLServer_Schemas on id

Unique Constraints: UQ_SA_SQLServer_Schemas_IDs on (database_id, schema_id)


SA_SQLServer_Objects

Description: Stores database objects (tables, views, stored procedures, functions, etc.) discovered on target instances. Mirrors sys.objects. Supports soft-delete via is_deleted.

Column NameData TypeSizeNullablePKFKDefaultDescription
idbigintNoPKIDENTITYSurrogate primary key
instance_idintNoReference to SA_SQLServer_Instances.id
database_idintYesReference to SA_SQLServer_Databases.id
namenvarchar128NoObject name
object_idintYesNative SQL Server object_id
principal_idintYesOwner principal ID
schema_idintYesSchema ID the object belongs to
parent_object_idintYesParent object (for triggers, constraints, etc.)
typenchar2YesObject type code (e.g., U, V, P, FN)
type_descnvarchar120YesObject type description
create_datedatetimeYesObject creation date
modify_datedatetimeYesLast modification date
is_ms_shippedbitYesWhether the object is Microsoft-shipped
is_publishedbitYesWhether the object is published for replication
is_schema_publishedbitYesWhether the schema is published
is_deletedbitNo0Soft-delete flag; set to 1 when object no longer exists on target

Primary Key: PK_SA_SQLServer_Objects on id

Indexes:

  • UQ_SA_SQLServer_Objects_Id — UNIQUE on (instance_id, database_id, object_id) WHERE object_id IS NOT NULL
  • UQ_SA_SQLServer_Objects_Name — UNIQUE on (instance_id, database_id, name, schema_id) WHERE object_id IS NULL
  • IX_SA_SQLServer_Objects_Database_Id_Object_Id on (database_id, object_id) INCLUDE (name, is_deleted)
  • SA_SQLServer_Objects_Instance_Id_Object_Id_Is_Deleted_IX on (instance_id, object_id, is_deleted) INCLUDE (id, name)

SA_SQLServer_Columns

Description: Stores column metadata for database objects. Mirrors sys.columns. Cascades delete from SA_SQLServer_Objects.

Column NameData TypeSizeNullablePKFKDefaultDescription
object_idbigintNoFKFK to SA_SQLServer_Objects.id (CASCADE delete)
namenvarchar128NoColumn name
column_idintNoOrdinal position of the column
system_type_idtinyintYesSystem data type ID
user_type_idintYesUser-defined type ID
max_lengthsmallintYesMaximum length in bytes
precisiontinyintYesNumeric precision
scaletinyintYesNumeric scale
collation_namenvarchar128YesColumn collation
is_nullablebitYesWhether column allows NULLs
is_ansi_paddedbitYesANSI padding setting
is_rowguidcolbitYesROWGUIDCOL flag
is_identitybitYesIdentity column flag
is_computedbitYesComputed column flag
is_filestreambitYesFILESTREAM flag
is_replicatedbitYesReplication flag
is_non_sql_subscribedbitYesNon-SQL subscription flag
is_merge_publishedbitYesMerge publication flag
is_dts_replicatedbitYesDTS replication flag
is_xml_documentbitYesXML document flag
xml_collection_idintYesXML schema collection ID
default_object_idintYesDefault constraint object ID
rule_object_idintYesRule object ID
is_sparsebitYesSparse column flag
is_column_setbitYesColumn set flag
is_deletedbitNo0Soft-delete flag

Primary Key: None (no PK constraint — uses unique constraint as logical key)

Unique Constraints: UQ_SA_SQLServer_Columns_Name on (object_id, column_id, name)

Foreign Keys: FK_SA_SQLServer_Columns_ObjectIdSA_SQLServer_Objects.id (ON DELETE CASCADE)


SA_SQLServer_ServerPrincipalTypes

Description: Lookup table for server principal type codes (e.g., S=SQL Login, U=Windows Login, R=Server Role, G=Windows Group).

Column NameData TypeSizeNullablePKFKDefaultDescription
typenchar1NoPKSingle-character principal type code
type_descnvarchar120NoHuman-readable description

Primary Key: PK_SA_SQLServer_ServerPrincipalTypes on type

Unique Constraints:

  • UQ_SA_SQLServer_ServerPrincipalTypes_Type on type
  • UQ_SA_SQLServer_ServerPrincipalTypes_TypeDesc on type_desc

SA_SQLServer_DatabasePrincipalTypes

Description: Lookup table for database principal type codes (e.g., S=SQL User, R=Database Role, U=Windows User).

Column NameData TypeSizeNullablePKFKDefaultDescription
typenchar1NoPKSingle-character principal type code
type_descnvarchar120NoHuman-readable description

Primary Key: PK_SA_SQLServer_DatabasePrincipalTypes on type

Unique Constraints:

  • UQ_SA_SQLServer_DatabasePrincipalTypes_Type on type
  • UQ_SA_SQLServer_DatabasePrincipalTypes_TypeDesc on type_desc

SA_SQLServer_ServerPrincipals

Description: Stores SQL Server-level principals (logins, server roles). Mirrors sys.server_principals. Supports soft-delete via is_deleted.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoFKFK to SA_SQLServer_Instances.id (CASCADE)
principal_idintYesNative principal_id from sys.server_principals
principal_namenvarchar128YesLogin/role name
principal_sidvarbinary85YesSecurity identifier (SID)
typenchar1YesPrincipal type code (S, U, G, R, C, K)
is_disabledbitYesWhether the login is disabled
create_datedatetimeYesCreation date
modify_datedatetimeYesLast modification date
default_databaseintYesFK to SA_SQLServer_Databases.id
default_language_namenvarchar128YesDefault language
credential_idintYesAssociated credential ID
is_deletedbitNo0Soft-delete flag
owning_principal_idintYesOwning principal for server roles
is_fixed_rolebitYesWhether this is a fixed server role

Primary Key: PK_SA_SQLServer_ServerPrincipals on id

Foreign Keys: FK_SA_SQLServer_ServerPrincipals_InstancesSA_SQLServer_Instances.id (ON DELETE CASCADE)

Indexes:

  • UQ_SA_SQLServer_ServerPrincipals_Id — UNIQUE on (instance_id, principal_id) WHERE is_deleted = 0
  • UQ_SA_SQLServer_ServerPrincipals_NameId — UNIQUE on (instance_id, principal_id, principal_name) WHERE is_deleted = 0
  • UQ_SA_SQLServer_ServerPrincipals_NameSid — UNIQUE on (instance_id, principal_sid, principal_name) WHERE is_deleted = 0

SA_SQLServer_DatabasePrincipals

Description: Stores database-level principals (users, database roles). Mirrors sys.database_principals. Supports soft-delete via is_deleted.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
database_idintNoFKFK to SA_SQLServer_Databases.id (CASCADE)
principal_idintYesNative principal_id from sys.database_principals
principal_namenvarchar128YesUser/role name
principal_sidvarbinary85YesSecurity identifier (SID)
typenchar1YesFKFK to SA_SQLServer_DatabasePrincipalTypes.type (CASCADE)
default_schema_namenvarchar128YesDefault schema for the principal
create_datedatetimeYesCreation date
modify_datedatetimeYesLast modification date
owning_principalintYesOwning principal ID (for roles)
is_fixed_rolebitYesWhether this is a fixed database role
authentication_typeintYesAuthentication type code
authentication_type_descnvarchar60YesAuthentication type description
is_deletedbitNo0Soft-delete flag

Primary Key: PK_SA_SQLServer_DatabasePrincipals on id

Foreign Keys:

  • FK_SA_SQLServer_DatabasePrincipals_DatabasesSA_SQLServer_Databases.id (ON DELETE CASCADE)
  • FK_SA_SQLServer_DatabasePrincipals_DatabasePrincipalTypesSA_SQLServer_DatabasePrincipalTypes.type (ON DELETE CASCADE)

Indexes:

  • UQ_SA_SQLServer_DatabasePrincipals_Id — UNIQUE on (database_id, principal_id) WHERE is_deleted = 0
  • UQ_SA_SQLServer_DatabasePrincipals_NameId — UNIQUE on (database_id, principal_id, principal_name) WHERE is_deleted = 0
  • UQ_SA_SQLServer_DatabasePrincipals_NameSid — UNIQUE on (database_id, principal_sid, principal_name) WHERE is_deleted = 0
  • IX_SA_SQLServer_Objects_Database_Id_Principal_Id on (database_id, principal_id)

SA_SQLServer_EventServerPrincipals

Description: Lightweight server principal reference for audit events. Decoupled from SA_SQLServer_ServerPrincipals so events can reference principals that may no longer exist in the current scan.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoFKFK to SA_SQLServer_Instances.id (CASCADE)
principal_idintYesServer principal ID from the audit event
principal_namenvarchar128YesPrincipal name from the audit event
principal_sidvarbinary85YesSID from the audit event

Primary Key: PK_SA_SQLServer_EventServerPrincipals on id

Foreign Keys: FK_SA_SQLServer_EventServerPrincipals_InstancesSA_SQLServer_Instances.id (ON DELETE CASCADE)

Indexes: UQ_SA_SQLServer_EventServerPrincipals_IdNameSid — UNIQUE on (instance_id, principal_id, principal_sid, principal_name)


SA_SQLServer_EventDatabasePrincipals

Description: Lightweight database principal reference for audit events.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
database_idintNoFKFK to SA_SQLServer_EventDatabases.id (CASCADE)
principal_idintYesDatabase principal ID from the audit event
principal_namenvarchar128YesPrincipal name from the audit event

Primary Key: PK_SA_SQLServer_EventDatabasePrincipals on id

Foreign Keys: FK_SA_SQLServer_EventDatabasePrincipals_EventDatabasesSA_SQLServer_EventDatabases.id (ON DELETE CASCADE)

Indexes: UQ_SA_SQLServer_EventDatabasePrincipals_IdNameSid — UNIQUE on (database_id, principal_id, principal_name)


SA_SQLServer_SqlLogins

Description: Stores SQL authentication-specific properties for server principals of type SQL Login. Extends SA_SQLServer_ServerPrincipals.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
server_principalintNoFKFK to SA_SQLServer_ServerPrincipals.id (CASCADE)
is_policy_checkedbitNoWhether password policy is enforced
is_expiration_checkedbitNoWhether password expiration is enforced
password_hashvarbinary256YesHashed password value
is_lockedbitYesAccount lockout status
is_expiredbitYesPassword expiration status
is_must_changebitYesWhether password must be changed at next login
password_hash_algorithmintYesAlgorithm used for hashing (SHA-1, SHA-512, etc.)

Primary Key: PK_SA_SQLServer_SqlLogins on id

Foreign Keys: FK_SA_SQLServer_SqlLogins_ServerPrincipalsSA_SQLServer_ServerPrincipals.id (ON DELETE CASCADE)


SA_SQLServer_ServerRoleMembers

Description: Maps server role membership relationships. Each row represents one principal's membership in one server role.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
role_principalintNoFKFK to SA_SQLServer_ServerPrincipals.id — the server role
member_principalintNoFKFK to SA_SQLServer_ServerPrincipals.id — the member

Primary Key: PK_SA_SQLServer_ServerRoleMembers on id

Foreign Keys:

  • FK_SA_SQLServer_ServerRoleMembers_RolePrincipalsSA_SQLServer_ServerPrincipals.id
  • FK_SA_SQLServer_ServerRoleMembers_MemberPrincipalsSA_SQLServer_ServerPrincipals.id

SA_SQLServer_DatabaseRoleMembers

Description: Maps database role membership relationships. Each row represents one principal's membership in one database role.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
role_principalintNoFKFK to SA_SQLServer_DatabasePrincipals.id — the database role
member_principalintNoFKFK to SA_SQLServer_DatabasePrincipals.id — the member

Primary Key: PK_SA_SQLServer_DatabaseRoles on id

Foreign Keys:

  • FK_SA_SQLServer_DatabaseRoleMembers_RolePrincipalsSA_SQLServer_DatabasePrincipals.id
  • FK_SA_SQLServer_DatabaseRoleMembers_MemberPrincipalsSA_SQLServer_DatabasePrincipals.id

SA_SQLServer_EffectiveRoleMembership

Description: Stores the fully resolved (transitive) role membership hierarchy. Includes nested memberships with the full member_path showing how a principal inherits a role through nested groups. This is a denormalized analysis table.

Column NameData TypeSizeNullablePKFKDefaultDescription
instance_idintYesInstance reference
instance_namenvarchar256YesInstance name (denormalized)
database_idintYesDatabase reference (NULL for server roles)
database_namenvarchar256YesDatabase name (denormalized)
role_namenvarchar128YesRole name
role_idintYesRole principal ID
role_sidvarchar184YesRole SID as string
role_member_namenvarchar128YesMember name
role_member_idintYesMember principal ID
role_member_sidvarchar184YesMember SID as string
role_member_typenvarchar27YesMember type description
member_pathnvarcharMAXYesFull nesting path (e.g., Role1 > Role2 > User)
nested_levelintYesDepth of nesting (0 = direct member)
membership_sourceintYesSource system: 0=Unset, 1=SqlServer, 2=ADI, 3=AzureADI, 4=Azure SQL, 5=Azure SQL Managed
database_typeintYesDatabase platform type

Primary Key: None (heap table)


SA_SQLServer_PermissionNames

Description: Lookup table mapping SQL Server permission type codes to their names (e.g., SLSELECT, EXEXECUTE).

Column NameData TypeSizeNullablePKFKDefaultDescription
typenchar4NoPKPermission type code from sys.database_permissions
permission_namenvarchar128NoHuman-readable permission name

Primary Key: PK_SA_SQLServer_PermissionNames on type

Unique Constraints:

  • UQ_SA_SQLServer_PermissionNames_Type on type
  • UQ_SA_SQLServer_PermissionNames_PermissionName on permission_name

SA_SQLServer_PermissionClasses

Description: Lookup table mapping permission class codes to descriptions (e.g., 0=SERVER, 1=DATABASE, 100=SERVER_PRINCIPAL).

Column NameData TypeSizeNullablePKFKDefaultDescription
classtinyintNoPKPermission class ID from sys.database_permissions
class_descnvarchar120NoClass description (DATABASE, OBJECT_OR_COLUMN, etc.)

Primary Key: PK_PermissionClasses on class

Unique Constraints:

  • UQ_SA_SQLServer_PermissionClasses_Class on class
  • UQ_SA_SQLServer_PermissionClasses_ClassDesc on class_desc

SA_SQLServer_PermissionStates

Description: Lookup table mapping permission state codes to descriptions (e.g., GGRANT, DDENY).

Column NameData TypeSizeNullablePKFKDefaultDescription
statenchar1NoPKPermission state code
state_descnvarchar120NoState description (GRANT, DENY, REVOKE, GRANT_WITH_GRANT_OPTION)

Primary Key: PK_SA_SQLServer_PermissionStates on state

Unique Constraints:

  • UQ_SA_SQLServer_PermissionStates_State on state
  • UQ_SA_SQLServer_PermissionStates_StateDesc on state_desc

SA_SQLServer_ServerPermissions

Description: Stores server-level permissions. Each row maps a grantee, grantor, permission type, and state for a server-scope securable.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoFKFK to SA_SQLServer_Instances.id (CASCADE)
classtinyintNoFKFK to SA_SQLServer_PermissionClasses.class (CASCADE)
major_idintNoMajor securable ID
minor_idintNoMinor securable ID (column-level)
grantee_principalintNoFKFK to SA_SQLServer_ServerPrincipals.id
grantor_principalintNoFKFK to SA_SQLServer_ServerPrincipals.id
typenchar4NoFKFK to SA_SQLServer_PermissionNames.type (CASCADE)
statenchar1NoFKFK to SA_SQLServer_PermissionStates.state (CASCADE)

Primary Key: PK_SA_SQLServer_ServerPermissions on id

Foreign Keys:

  • FK_SA_SQLServer_ServerPermissions_InstancesSA_SQLServer_Instances.id (CASCADE)
  • FK_SA_SQLServer_ServerPermissions_PermissionClassesSA_SQLServer_PermissionClasses.class (CASCADE)
  • FK_SA_SQLServer_ServerPermissions_PermissionNamesSA_SQLServer_PermissionNames.type (CASCADE)
  • FK_SA_SQLServer_ServerPermissions_PermissionStatesSA_SQLServer_PermissionStates.state (CASCADE)
  • FK_SA_SQLServer_ServerPermissions_GranteeServerPrincipalsSA_SQLServer_ServerPrincipals.id
  • FK_SA_SQLServer_ServerPermissions_GrantorServerPrincipalsSA_SQLServer_ServerPrincipals.id

SA_SQLServer_DatabasePermissions

Description: Stores database-level permissions. Each row maps a grantee, grantor, permission type, and state for a database-scope securable.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
database_idintNoFKFK to SA_SQLServer_Databases.id
classtinyintNoFKFK to SA_SQLServer_PermissionClasses.class (CASCADE)
major_idintNoMajor securable ID (object, schema, etc.)
minor_idintNoMinor securable ID (column)
grantee_principalintNoFKFK to SA_SQLServer_DatabasePrincipals.id
grantor_principalintNoFKFK to SA_SQLServer_DatabasePrincipals.id
typenchar4NoFKFK to SA_SQLServer_PermissionNames.type
statenchar1NoFKFK to SA_SQLServer_PermissionStates.state

Primary Key: PK_SA_SQLServer_DatabasePermissions on id

Foreign Keys:

  • FK_SA_SQLServer_DatabasePermissions_DatabasesSA_SQLServer_Databases.id
  • FK_SA_SQLServer_DatabasePermissions_GranteeDatabasePrincipalsSA_SQLServer_DatabasePrincipals.id
  • FK_SA_SQLServer_DatabasePermissions_GrantorDatabasePrincipalsSA_SQLServer_DatabasePrincipals.id
  • FK_SA_SQLServer_DatabasePermissions_PermissionClassesSA_SQLServer_PermissionClasses.class (ON DELETE CASCADE)
  • FK_SA_SQLServer_DatabasePermissions_PermissionNamesSA_SQLServer_PermissionNames.type
  • FK_SA_SQLServer_DatabasePermissions_PermissionStatesSA_SQLServer_PermissionStates.state

Indexes: SA_SQLServer_DatabasePermissions_Database_Id_Grantee_Principal_IX on (database_id, grantee_principal) INCLUDE (id, class, major_id, minor_id, grantor_principal, type, state)


SA_SQLServer_AsymmetricKeys

Description: Stores asymmetric key metadata discovered in databases. Maps sys.asymmetric_keys.

Column NameData TypeSizeNullablePKFKDefaultDescription
database_idintNoFKFK to SA_SQLServer_Databases.id
namenvarchar128NoKey name
database_principalintYesFKFK to SA_SQLServer_DatabasePrincipals.id
asymmetric_key_idintYesNative key ID
pvt_key_encryption_typenchar2YesPrivate key encryption type code
pvt_key_encryption_type_descnvarchar120YesEncryption type description
thumbprintvarbinary32YesKey thumbprint
algorithmnchar2YesAlgorithm code
algorithm_descnvarchar120YesAlgorithm description
key_lengthintYesKey length in bits
public_keyvarbinaryMAXYesPublic key bytes
sidvarbinary85YesSID mapped to the key
string_sidnvarchar128YesSID as string
attested_bynvarchar260YesAttestation path
provider_typenvarchar120YesCryptographic provider type
cryptographic_provider_guiduniqueidentifierYesProvider GUID
cryptographic_provider_algidsql_variantYesProvider algorithm ID

Primary Key: None

Unique Constraints: UQ_SA_SQLServer_AsymmetricKeys_Type on (database_id, name)

Foreign Keys:

  • FK_SA_SQLServer_AsymmetricKeys_DatabasesSA_SQLServer_Databases.id
  • FK_SA_SQLServer_AsymmetricKeys_DatabasePrincipalSA_SQLServer_DatabasePrincipals.id

SA_SQLServer_AuditInformation

Description: Stores SQL Server audit configuration metadata. Each row represents one audit definition on an instance.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoReference to hosting instance
database_idintYesDatabase scope (used by Azure Activity)
audit_idintNoNative audit ID
namenvarchar128NoAudit name
audit_guiduniqueidentifierYesAudit GUID
create_datedatetimeNoAudit creation date
modify_datedatetimeNoLast modification date
principal_idintYesOwner principal
typechar2NoAudit type (SL=Security Log, AL=Application Log, FL=File)
type_descnvarchar120YesType description
on_failuretinyintYesFailure action code
on_failure_descnvarchar120YesFailure action description
is_state_enabledbitYesWhether audit is enabled
queue_delayintYesQueue delay in milliseconds
predicatenvarchar3000YesFilter predicate expression
status_descnvarchar512YesCurrent status description
status_timedatetime2YesStatus timestamp
event_session_addressvarbinary8YesExtended events session address
audit_file_pathnvarchar1024YesFile path for file-based audits
audit_file_sizebigintYesCurrent audit file size
max_file_sizebigintYesMaximum file size
max_rollover_filesintYesMaximum rollover file count
max_filesintYesMaximum total file count
reserve_disk_spaceintYesDisk space reservation
log_file_pathnvarchar1024YesLog file path
log_file_namenvarchar520YesLog file name

Primary Key: PK_SA_SQLServer_AuditInformation on id


SA_SQLServer_AuditFiles

Description: Stores audit file paths. Multiple files can be associated with one audit via rollover.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
audit_idintYesFKFK to SA_SQLServer_AuditInformation.id (CASCADE)
audit_file_pathnvarchar1024NoFull path to the audit file
md5_audit_file_pathvarbinary16YesComputed column: CONVERT(varbinary(16), HASHBYTES('MD5', audit_file_path)). MD5 hash for uniqueness lookups

Primary Key: PK_SA_SQLServer_AuditFiles on id

Foreign Keys: FK_SA_SQLServer_AuditFiles_AuditIdSA_SQLServer_AuditInformation.id (ON DELETE CASCADE)

Indexes: UQ_SA_SQLServer_AuditFiles_Path_Audit_Id — UNIQUE on (audit_id, md5_audit_file_path) WHERE audit_id IS NOT NULL


SA_SQLServer_AuditClassType

Description: Lookup table for audit class type codes used in audit events.

Column NameData TypeSizeNullablePKFKDefaultDescription
class_typenchar2NoPKTwo-character class type code
class_type_descnvarchar120NoClass type description (e.g., SERVER, DATABASE)
securable_class_descnvarchar120NoAssociated securable class

Primary Key: PK_SA_SQLServer_AuditClassType on class_type


SA_SQLServer_AuditActions

Description: Lookup table for audit action types. Maps action IDs to human-readable names.

Column NameData TypeSizeNullablePKFKDefaultDescription
action_idnvarchar4NoAction code (e.g., LGIS, LGIF, SL, EX)
class_typenchar2NoClass type this action applies to
parent_class_typenchar2YesParent class type (for nested actions)
namenvarchar128NoAction name (e.g., LOGIN_SUCCEEDED, SELECT)

Primary Key: None

Unique Constraints: UQ_SA_SQLServer_AuditActions on (action_id, class_type, parent_class_type)


SA_SQLServer_Statements

Description: Stores unique SQL statements captured in audit events. Uses MD5 deduplication to avoid storing identical statements repeatedly.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
statementnvarchar4000NoSQL statement text
md5_statementvarbinary16YesComputed column: CONVERT(varbinary(16), HASHBYTES('MD5', statement)). MD5 hash for deduplication

Primary Key: PK_SA_SQLServer_Queries on id

Unique Constraints: UQ_SA_SQLServer_Statements_Statement on md5_statement


SA_SQLServer_AdditionalInformation

Description: Stores unique additional_information XML fragments from audit events. MD5-deduplicated.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
additional_informationnvarchar4000NoAdditional information text from audit event
md5_additional_informationvarbinary16YesComputed column: CONVERT(varbinary(16), HASHBYTES('MD5', additional_information)). MD5 hash for deduplication

Primary Key: PK_SA_SQLServer_AdditionalInformation on id

Unique Constraints: UQ_SA_SQLServer_AdditionalInformation_AdditionalInformation on md5_additional_information


SA_SQLServer_UserEvents

Description: Stores unique user-defined event information from audit records. MD5-deduplicated.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoReference to hosting instance
user_defined_event_idsmallintNoUser event ID code
user_defined_informationnvarchar4000NoUser-defined event payload
md5_user_defined_informationvarbinary16YesComputed column: CONVERT(varbinary(16), HASHBYTES('MD5', user_defined_information)). MD5 hash for deduplication

Primary Key: PK_SA_SQLServer_UserEvents on id

Unique Constraints: UQ_SA_SQLServer_UserEvents_UserDefinedInformation on md5_user_defined_information

Indexes: SA_SQLServer_UserEvents_user_defined_event_id_IDX on user_defined_event_id (nonclustered)


SA_SQLServer_Events

Description: Central audit event fact table. Stores one row per audit event. Has extensive foreign keys to dimension/lookup tables for normalization.

Column NameData TypeSizeNullablePKFKDefaultDescription
event_timedatetime2(7)NoEvent timestamp with high precision
sequence_numberintNoSequence within the same timestamp
action_idvarchar4YesAudit action code (e.g., LGIS, SL)
succeededbitNoWhether the action succeeded
session_idsmallintNoSQL Server session ID
object_idintNoTarget object ID
object_namenvarchar128YesTarget object name
class_typevarchar2YesAudit class type code
schema_namenvarchar128YesSchema of the target object
audit_file_offsetbigintNoByte offset within the audit file
audit_schema_versionintYesAudit schema version
sequence_group_idvarbinary85YesSequence group identifier
file_idintYesFKFK to SA_SQLServer_AuditFiles.id
instance_idintYesFKFK to SA_SQLServer_Instances.id
database_idintYesFKFK to SA_SQLServer_EventDatabases.id
server_principalintYesFKFK to SA_SQLServer_EventServerPrincipals.id
session_server_principalintYesFKFK to SA_SQLServer_EventServerPrincipals.id
database_principalintYesFKFK to SA_SQLServer_EventDatabasePrincipals.id
target_server_principalintYesFKFK to SA_SQLServer_EventServerPrincipals.id
target_database_principalintYesFKFK to SA_SQLServer_EventDatabasePrincipals.id
permission_bitmaskvarbinary16YesPermission bitmask
is_column_permissionbitYesWhether this is a column-level permission
statement_idintYesFKFK to SA_SQLServer_Statements.id
additional_information_idintYesFKFK to SA_SQLServer_AdditionalInformation.id
user_event_idintYesFKFK to SA_SQLServer_UserEvents.id
client_ipnvarchar128YesClient IP address
application_namenvarchar128YesApplication name from the connection

Primary Key: None (heap table — events are append-only)

Foreign Keys (11):

  • FK_SA_SQLServer_Events_InstancesSA_SQLServer_Instances.id
  • FK_SA_SQLServer_Events_EventDatabasesSA_SQLServer_EventDatabases.id
  • FK_SA_SQLServer_Events_FileIdSA_SQLServer_AuditFiles.id
  • FK_SA_SQLServer_Events_EventServerPrincipalsSA_SQLServer_EventServerPrincipals.id
  • FK_SA_SQLServer_Events_SessionEventServerPrincipalsSA_SQLServer_EventServerPrincipals.id
  • FK_SA_SQLServer_Events_TargetEventServerPrincipalsSA_SQLServer_EventServerPrincipals.id
  • FK_SA_SQLServer_Events_EventDatabasePrincipalsSA_SQLServer_EventDatabasePrincipals.id
  • FK_SA_SQLServer_Events_TargetEventDatabasePrincipalsSA_SQLServer_EventDatabasePrincipals.id
  • FK_SA_SQLServer_Events_StatementsSA_SQLServer_Statements.id
  • FK_SA_SQLServer_Events_AdditionalInformationSA_SQLServer_AdditionalInformation.id
  • FK_SA_SQLServer_Events_UserEventsSA_SQLServer_UserEvents.id

Indexes: UQ_SA_SQLServer_Events_StaleDataLookup on (file_id, event_time) (nonclustered, non-unique despite UQ_ prefix)

Note: Despite the UQ_ prefix used in some environments, this index is not unique per the live schema (is_unique = 0).


SA_SQLServer_ExpressionDependencies

Description: Stores SQL expression dependencies between database objects. Mirrors sys.sql_expression_dependencies.

Column NameData TypeSizeNullablePKFKDefaultDescription
idbigintNoPKIDENTITYSurrogate primary key
instance_idintNoInstance reference
database_idintNoDatabase reference
referencing_idintNoObject ID of the referencing entity
referencing_minor_idintNoColumn ID of the referencing entity
referencing_classtinyintYesReferencing entity class
referencing_class_descnvarchar60YesReferencing class description
is_schema_bound_referencebitNoWhether this is a schema-bound reference
referenced_classtinyintYesReferenced entity class
referenced_class_descnvarchar60YesReferenced class description
referenced_server_namenvarchar256YesCross-server reference target
referenced_database_namenvarchar256YesCross-database reference target
referenced_schema_namenvarchar256YesReferenced schema
referenced_entity_namenvarchar256YesReferenced entity name
referenced_idintYesReferenced object ID
referenced_minor_idintNoReferenced column ID
is_caller_dependentbitNoCaller-dependent resolution flag
is_ambiguousbitNoAmbiguous reference flag
referencing_schema_namenvarchar256YesReferencing schema name
referencing_object_namenvarchar256YesReferencing object name

Primary Key: Auto-generated on id

Indexes: IDX_SA_SQLServer_ExpressionDependencies_Ids on (instance_id, database_id, referencing_id)


SA_SQLServer_SDD_Criteria

Description: Stores Sensitive Data Discovery (SDD) pattern criteria definitions. Each criterion defines a pattern to match (e.g., SSN, credit card numbers).

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
namenvarcharMAXNoCriteria name (e.g., "Social Security Number")
pattern_guiduniqueidentifierNoUnique GUID identifying the pattern definition

Primary Key: PK_SA_SQLServer_SDD_Criteria on id

Unique Constraints: UQ_SA_SQLServer_SDD_Criteria_pattern on pattern_guid


SA_SQLServer_SDD_InstanceCriteria

Description: Junction table linking SDD criteria to instances they should be scanned against.

Column NameData TypeSizeNullablePKFKDefaultDescription
instance_idintNoFKFK to SA_SQLServer_Instances.id
criteria_idintNoFKFK to SA_SQLServer_SDD_Criteria.id

SA_SQLServer_SDD_DatabaseCriteria

Description: Junction table linking SDD criteria to specific databases.

Column NameData TypeSizeNullablePKFKDefaultDescription
database_idintNoFKFK to SA_SQLServer_Databases.id
criteria_idintNoFKFK to SA_SQLServer_SDD_Criteria.id

Indexes: SA_SQLServer_SDD_DatabaseCriteria_database_id on database_id


SA_SQLServer_SDD_ResourceTypes

Description: Lookup table for SDD resource types (e.g., Table, Column, Instance, Database).

Column NameData TypeSizeNullablePKFKDefaultDescription
idtinyintNoPKResource type ID
type_descnvarchar100NoResource type description

Primary Key: PK_SA_SQLServer_ResourceTypes on id

Unique Constraints: UQ_SA_SQLServer_ResourceTypes_TypeDesc on type_desc


SA_SQLServer_SDD_Resources

Description: Stores scannable resources (instances, databases, tables, columns) for SDD. Each resource represents a specific scope that can be scanned for sensitive data.

Column NameData TypeSizeNullablePKFKDefaultDescription
idbigintNoPKIDENTITYSurrogate primary key
typetinyintNoFKFK to SA_SQLServer_SDD_ResourceTypes.id
instance_idintNoFKFK to SA_SQLServer_Instances.id
database_idintYesFKFK to SA_SQLServer_Databases.id
object_idbigintYesFKFK to SA_SQLServer_Objects.id
column_idintYesColumn ordinal (if column-level resource)
last_scannedintYesFKFK to SA_SQLServer_SDD_ScanHistory.id

Primary Key: PK_SA_SQLServer_SDD_Resources on id

Unique Constraints: UQ_SA_SQLServer_SDD_Resources_Resource on (type, instance_id, database_id, object_id, column_id)

Indexes: SA_SQLServer_SDD_Resources_Database_Id_Object_Id_IX on (database_id, object_id) (nonclustered)


SA_SQLServer_SDD_Matches

Description: Stores aggregate match results — how many times a criteria pattern matched within a resource.

Column NameData TypeSizeNullablePKFKDefaultDescription
resource_idbigintNoFKFK to SA_SQLServer_SDD_Resources.id
criteria_idintNoFKFK to SA_SQLServer_SDD_Criteria.id
match_countintNoNumber of matches found
match_locationbigintNo0Bitmask: 1=Content, 2=Metadata, 4=Filename

SA_SQLServer_SDD_MatchHits

Description: Stores individual match hit details — the actual data fragments that matched a criteria pattern.

Column NameData TypeSizeNullablePKFKDefaultDescription
resource_idbigintNoFKFK to SA_SQLServer_SDD_Resources.id
criteria_idintNoFKFK to SA_SQLServer_SDD_Criteria.id
match_datanvarchar1024NoMatched data fragment (potentially masked)
hit_columnnvarcharMAXYesColumn name where the hit was found
match_locationbigintNo0Location bitmask

SA_SQLServer_SDD_MatchHits_SubjectProfile

Description: Links SDD match hits to Subject Profile identities (e.g., mapping a discovered SSN to a known person). Cross-references SA_SubjectProfile_* tables.

Column NameData TypeSizeNullablePKFKDefaultDescription
resource_idbigintNoPKFKFK to SA_SQLServer_SDD_Resources.id (CASCADE)
criteria_idintNoPKFKFK to SA_SQLServer_SDD_Criteria.id
source_idintNoPKFKFK to SA_SubjectProfile_Sources.Id
identity_idbigintNoPKFKFK to SA_SubjectProfile_Identities.Id
attribute_idintNoPKFKFK to SA_SubjectProfile_AttributeValues (composite)
orderintNoPKOrdering within the attribute value set

Primary Key: Composite on (resource_id, criteria_id, source_id, identity_id, attribute_id, order)


SA_SQLServer_SDD_ScanHistory

Description: Tracks SDD scan execution history with timestamps and completion status.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
instance_idintNoFKFK to SA_SQLServer_Instances.id
scan_datedatetime2(7)NoGETUTCDATE()Scan start timestamp
abortedbitNo0Whether the scan was aborted
last_resource_scannedbigintYesFKFK to SA_SQLServer_SDD_Resources.id (CASCADE); resume point

Primary Key: PK_SA_SQLServer_SDD_ScanHistory on id


SA_SQLServer_SDD_SupportedDataTypes

Description: Configuration table listing SQL Server data types that can be scanned by SDD, with conversion rules for binary types.

Column NameData TypeSizeNullablePKFKDefaultDescription
idintNoPKIDENTITYSurrogate primary key
data_typenvarchar64NoSQL Server data type name (e.g., varchar, int)
is_convertedbitNo0Whether the type requires conversion before scanning
is_enabledbitNo0Whether scanning is enabled for this type
converted_data_typenvarchar128YesTarget data type after conversion
converted_data_byte_sizeintYesByte size of converted type
converted_character_setnvarchar128YesCharacter set for conversion

Primary Key: PK_SA_SQLServer_SDD_SupportedDataTypes on id

Unique Constraints: IX_SA_SQLServer_SDD_SupportedDataTypes on data_type


SA_SQL_Patches

Description: Schema version tracking table used by the NAA patching system. Records which incremental schema patches have been applied to this database. The SaSchemaUpdator component checks this table at runtime to determine which patches are pending and applies them sequentially. Each Patch_Source represents a different data collector module, and Patch_Version is incremented with each schema change for that module.

Column NameData TypeSizeNullablePKFKDefaultDescription
Patch_Sourcenvarchar64NoPKData collector module identifier (e.g., SqlServer, Oracle, DC, MySQL, PostgreSql, Db2LUW, AzureSqlStandalone)
Patch_VersionintNoPKSequential patch version number; version 1 = initial table creation, versions 2+ = incremental schema modifications

Primary Key: PK_SA_SQL_Patches on (Patch_Source, Patch_Version)

Patching Architecture:

  • Version 1 for each source is the initial CREATE TABLE script (marked AlwaysRun = true — re-executed every run for idempotent initialization)
  • Versions 2+ are incremental patches (e.g., SqlServer_1_2.sql through SqlServer_1_15.sql) that alter columns, add indexes, etc.
  • Patches marked IsCritical = true (default) halt the updater on failure; non-critical patches log errors and continue
  • The SelfInsertsPatchRecord flag allows patches to manage their own version tracking entry
  • Thread-safe: SaSchemaUpdator uses a static lock to prevent concurrent schema modifications

Patch Levels:

Patch_SourceVersions AppliedLatest Version
SqlServer1–1515
Oracle1–99
DC3, 4, 5, 7, 88
MySQL1–22
PostgreSql1, 33
Db2LUW11
AzureSqlServer11

SA_SQL_Instances

Description: Central cross-module instance registry table. Stores metadata about all monitored SQL Server instances and is referenced by the sql_instance_id column in SA_SQLServer_Instances and by multiple views via database_usage_mode. This table is shared across all database collector modules (SQL Server, Oracle, MySQL, PostgreSQL, Db2 LUW).

Column NameData TypeSizeNullablePKFKDefaultDescription
instance_idintNoPKIDENTITYAuto-incrementing surrogate primary key
instance_labelnvarchar256NoUnique display label for the instance
service_namenvarchar128YesNamed instance or service/database name
is_activebitNo1Whether the instance is currently active for data collection
enable_impersonationbitNo0Whether Windows impersonation is enabled for connecting to this instance
database_typeintNoDatabase platform type (see Section 6.11)
host_namenvarchar150NoServer hostname or IP address
port_numberintNoTCP port number
database_usage_modeintNo0Usage mode: 0=On-Premises, other values for cloud deployments
default_database_namenvarchar150YesDefault database name for the connection
was_inspectedbitNo0Whether the instance has been inspected/discovered
inspected_datedatetime2No1950-01-01Timestamp of last inspection
connection_stringnvarchar1024YesStored connection string for the instance

Primary Key: PK_SA_SQL_Instances on instance_id

Unique Constraints:

  • UQ_SA_SQL_Instances on instance_label
  • UQ_SA_SQL_Instances_Host_Name_Service_Name_Port on (host_name, service_name, port_number)

SA_SQL_PasswordIssues_LIST

Description: Stores password audit list metadata used by the password issues scan. Tracks which password lists have been applied to which hosts, with versioning to detect when lists need updating.

Column NameData TypeSizeNullablePKFKDefaultDescription
SA_HOSTvarchar255NoTarget host identifier
rowGUIDuniqueidentifierNoNEWSEQUENTIALID()Unique row identifier
JobRunTimeKeysmalldatetimeYesJob execution timestamp key
HOSTvarchar255YesHost name
HOSTSTATUSvarchar20YesHost processing status
SequenceIDvarchar64YesSequence identifier
ListVersionvarchar256YesPassword list version
DbListVersionvarchar256YesDatabase-stored list version
Updatedvarchar5YesWhether the list was updated (True/False)
TableNamevarchar256YesTarget table name
ROWKEYvarchar1600YesRow key for identifying records

Indexes:

  • SA_SQL_PasswordIssues_LIST_PK_Index — UNIQUE on rowGUID
  • SA_SQL_PasswordIssues_LIST_Host_Index on SA_HOST
  • SA_SQL_PasswordIssues_LIST_JobRuntimeKey_Index on JobRunTimeKey