Skip to content

Commit 1278e1e

Browse files
committed
Add Data Classification APIs
1 parent b8a12ea commit 1278e1e

1 file changed

Lines changed: 53 additions & 11 deletions

File tree

docs/connect/ado-net/sql/data-classification.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Data discovery and classification in SqlClient"
33
description: "Describes how to check if a SQL Server database supports data classification and how to access data classification information through a SqlDataReader object."
4-
ms.date: "06/15/2020"
4+
ms.date: "11/23/2020"
55
dev_langs:
66
- "csharp"
77
ms.prod: sql
@@ -20,29 +20,71 @@ ms.reviewer:
2020

2121
[Data Discovery & Classification](../../../relational-databases/security/sql-data-discovery-and-classification.md) is a set of advanced services for discovering, classifying, labeling & reporting the sensitive data in your databases. SqlClient provides an API exposing read-only Data Discovery and Classification information when the underlying source supports the feature. This information is accessed through SqlDataReader.
2222

23-
Microsoft.Data.SqlClient v2.1.0 introduces support for Data Classification's `Sensitivity Rank` information. `Sensitivity Rank` is an identifier based on a predefined set of values, which define sensitivity rank. It can be used by other services like Advanced Threat Protection to detect anomalies based on their rank. The following new APIs are now available in Microsoft.Data.SqlClient namespace:
23+
Microsoft.Data.SqlClient v2.1.0 introduces support for Data Classification's `Sensitivity Rank` information. `Sensitivity Rank` is an identifier based on a predefined set of values, which define sensitivity rank. It can be used by other services like Advanced Threat Protection to detect anomalies based on their rank. The following Data Classification APIs are now available in Microsoft.Data.SqlClient.DataClassification namespace:
2424

2525
```csharp
26-
public class SensitivityClassification
26+
// New in Microsoft.Data.SqlClient v2.1.0
27+
public enum SensitivityRank
28+
{
29+
NOT_DEFINED = -1,
30+
NONE = 0,
31+
LOW = 10,
32+
MEDIUM = 20,
33+
HIGH = 30,
34+
CRITICAL = 40
35+
}
36+
37+
public sealed class SensitivityClassification
2738
{
2839
// Returns the sensitivity rank for the query associated with the active 'SqlDataReader'.
40+
// New in Microsoft.Data.SqlClient v2.1.0
2941
public SensitivityRank SensitivityRank;
42+
43+
// Returns the labels collection for this 'SensitivityClassification' Object
44+
public ReadOnlyCollection<Label> Labels;
45+
46+
// Returns the information types collection for this 'SensitivityClassification' Object
47+
public ReadOnlyCollection<InformationType> InformationTypes;
48+
49+
// Returns the column sensitivity for this 'SensitivityClassification' Object
50+
public ReadOnlyCollection<ColumnSensitivity> ColumnSensitivities;
3051
}
3152

32-
public class SensitivityProperty
53+
public sealed class SensitivityProperty
3354
{
3455
// Returns the sensitivity rank for this 'SensitivityProperty' Object
56+
// New in Microsoft.Data.SqlClient v2.1.0
3557
public SensitivityRank SensitivityRank;
58+
59+
// Returns the label for this 'SensitivityProperty' Object
60+
public Label Label;
61+
62+
// Returns the information type for this 'SensitivityProperty' Object
63+
public InformationType InformationType;
3664
}
3765

38-
public enum SensitivityRank
66+
public sealed class Label
3967
{
40-
NOT_DEFINED = -1,
41-
NONE = 0,
42-
LOW = 10,
43-
MEDIUM = 20,
44-
HIGH = 30,
45-
CRITICAL = 40
68+
// Gets the name for this 'Label' object
69+
public string Name;
70+
71+
// Gets the ID for this 'Label' object
72+
public string Id;
73+
}
74+
75+
public sealed class InformationType
76+
{
77+
// Gets the name for this 'InformationType' object
78+
public string Name;
79+
80+
// Gets the ID for this 'InformationType' object
81+
public string Id;
82+
}
83+
84+
public sealed class ColumnSensitivity
85+
{
86+
// Returns the list of sensitivity properties as received from Server for this 'ColumnSensitivity' information
87+
public ReadOnlyCollection<SensitivityProperty> SensitivityProperties;
4688
}
4789
```
4890

0 commit comments

Comments
 (0)