Skip to content

Support Data classification #6316

@matt2005

Description

@matt2005

Summary of new feature

  • Support add/removing/updating of data classification for a table column

Proposed technical details (if applicable)

  • Classification Information types and Sensitivity are stored as extended properties on tables
    • The values are GUID's, I've found a mapping table here GUID Mapping
  • Below is the SQL code that was added when adding a Classification to TABLE1 and Column 'EXPIRATION_TS'. the classfication was Information type: [NA] and Sensitivity: General
EXEC sys.sp_addextendedproperty 
     @name = N'sys_information_type_id', 
     @value = N'', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'TABLE1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO
EXEC sys.sp_addextendedproperty 
     @name = N'sys_information_type_name', 
     @value = N'', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'TABLE1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO
EXEC sys.sp_addextendedproperty 
     @name = N'sys_sensitivity_label_id', 
     @value = N'684a0db2-d514-49d8-8c0c-df84a7b083eb', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'TABLE1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO
EXEC sys.sp_addextendedproperty 
     @name = N'sys_sensitivity_label_name', 
     @value = N'General', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'TABLE1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO

Here is the same but with the Information Type set to Other

EXEC sys.sp_addextendedproperty 
     @name = N'sys_information_type_id', 
     @value = N'9C5B4809-0CCC-0637-6547-91A6F8BB609D', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'Table1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO
EXEC sys.sp_addextendedproperty 
     @name = N'sys_information_type_name', 
     @value = N'Other', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'Table1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO
EXEC sys.sp_addextendedproperty 
     @name = N'sys_sensitivity_label_id', 
     @value = N'684a0db2-d514-49d8-8c0c-df84a7b083eb', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'Table1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO
EXEC sys.sp_addextendedproperty 
     @name = N'sys_sensitivity_label_name', 
     @value = N'General', 
     @level0type = N'SCHEMA', 
     @level0name = N'dbo', 
     @level1type = N'TABLE', 
     @level1name = N'Table1', 
     @level2type = N'COLUMN', 
     @level2name = N'EXPIRATION_TS';
GO

Latest version of dbatools as of writing

  • dbatools 1.0.83

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedLabel to be used by maintainers that confirm a bug does exist for the given issuefeature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions