Skip to content

Commit 91908a5

Browse files
committed
Update descriptions
Acrolinx improvements Markdownlint fixes
1 parent e24b695 commit 91908a5

2 files changed

Lines changed: 116 additions & 125 deletions

File tree

docs/connect/odbc/data-classification.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Using Data Classification with Microsoft ODBC Driver for SQL Server"
3-
title: "Using Data Classification with Microsoft ODBC Driver for SQL Server | Microsoft Docs"
2+
description: Learn how to use Data Classification with the ODBC driver and how to incorporate your data protection policies into your ODBC application.
3+
title: Using Data Classification ODBC driver
44
ms.custom: ""
55
ms.date: "07/26/2018"
66
ms.prod: sql
@@ -16,19 +16,22 @@ ms.author: v-makouz
1616
manager: kenvh
1717
---
1818
# Data Classification
19+
1920
[!INCLUDE[Driver_ODBC_Download](../../includes/driver_odbc_download.md)]
2021

2122
## Overview
22-
For the purpose of managing sensitive data, SQL Server and Azure SQL Server introduced the ability to provide database columns with sensitivity metadata that allows the client application to handle different types of sensitive data (such as health, financial, etc.) in accordance with data protection policies.
23+
24+
For managing sensitive data, SQL Server and Azure SQL Server introduced the ability to provide database columns with sensitivity metadata that allows the client application to handle different types of sensitive data (such as health, financial, etc.) in accordance with data protection policies.
2325

2426
For more information on how to assign classification to columns, see [SQL Data Discovery and Classification](../../relational-databases/security/sql-data-discovery-and-classification.md).
2527

2628
Microsoft ODBC Driver 17.2 allows the retrieval of this metadata via SQLGetDescField using the SQL_CA_SS_DATA_CLASSIFICATION field identifier.
2729

2830
## Format
31+
2932
SQLGetDescField has the following syntax:
3033

31-
```
34+
```cpp
3235
SQLRETURN SQLGetDescField(
3336
SQLHDESC DescriptorHandle,
3437
SQLSMALLINT RecNumber,
@@ -37,8 +40,9 @@ SQLRETURN SQLGetDescField(
3740
SQLINTEGER BufferLength,
3841
SQLINTEGER * StringLengthPtr);
3942
```
43+
4044
*DescriptorHandle*
41-
[Input] IRD(Implementation Row Descriptor) handle. Can be retrieved by a call to SQLGetStmtAttr with SQL_ATTR_IMP_ROW_DESC statement attribute
45+
[Input] IRD (Implementation Row Descriptor) handle. Can be retrieved by a call to SQLGetStmtAttr with SQL_ATTR_IMP_ROW_DESC statement attribute
4246
4347
*RecNumber*
4448
[Input] 0
@@ -54,11 +58,11 @@ SQLRETURN SQLGetDescField(
5458
5559
*StringLengthPtr*
5660
[Output] Pointer to the buffer in which to return the total number of bytes available to return in *ValuePtr*.
57-
61+
5862
> [!NOTE]
5963
> If the size of the buffer is unknown, it can be determined by calling SQLGetDescField with *ValuePtr* as NULL and examining the value of *StringLengthPtr*.
60-
61-
If Data Classification information is not available, an *Invalid Descriptor Field* error will be returned.
64+
65+
If Data Classification information isn't available, an *Invalid Descriptor Field* error will be returned.
6266
6367
Upon a successful call to SQLGetDescField, the buffer pointed to by *ValuePtr* will contain the following data:
6468
@@ -83,11 +87,10 @@ s - index into the *`sensitivitylabels`* array, `FF FF` if not labeled
8387
8488
t - index into the *`informationtypes`* array, `FF FF` if not labeled
8589
86-
8790
<br><br>
8891
The format of the data can be expressed as the following pseudo-structures:
8992
90-
```
93+
```cpp
9194
struct IDnamePair {
9295
BYTE nameLen;
9396
USHORT name[nameLen];
@@ -111,11 +114,11 @@ struct {
111114
} columnClassification[nColumns];
112115
```
113116

114-
115117
## Code sample
118+
116119
Test application that demonstrates how to read Data Classification metadata. On Windows it can be compiled using `cl /MD dataclassification.c /I (directory of msodbcsql.h) /link odbc32.lib` and run with a connection string, and a SQL query (that returns classified columns) as parameters:
117120

118-
```
121+
```cpp
119122
#ifdef _WIN32
120123
#include <windows.h>
121124
#endif
@@ -240,22 +243,23 @@ int main(int argc, char **argv)
240243
```
241244
242245
## <a name="bkmk-version"></a>Supported Version
243-
Microsoft ODBC Driver 17.2 allows the retrieval of Data Classification information via `SQLGetDescField` if `FieldIdentifier` is set to `SQL_CA_SS_DATA_CLASSIFICATION` (1237).
244246
245-
Starting from Microsoft ODBC Driver 17.4.1.1 it is possible to retrieve version of Data Classification supported by a server via `SQLGetDescField` using the `SQL_CA_SS_DATA_CLASSIFICATION_VERSION` (1238) field identifier. In 17.4.1.1 the supported data classification version is set to "2".
247+
Microsoft ODBC Driver 17.2 allows the retrieval of Data Classification information via `SQLGetDescField` if `FieldIdentifier` is set to `SQL_CA_SS_DATA_CLASSIFICATION` (1237).
246248
247-
249+
Starting from Microsoft ODBC Driver 17.4.1.1, it's possible to retrieve the version of Data Classification supported by a server via `SQLGetDescField` using the `SQL_CA_SS_DATA_CLASSIFICATION_VERSION` (1238) field identifier. In 17.4.1.1, the supported data classification version is set to "2".
248250
249-
Starting from 17.4.2.1 introduced the default version of data classification which is set to "1" and is the version driver is reporting to SQL Server as supported. New connection attribute `SQL_COPT_SS_DATACLASSIFICATION_VERSION` (1400) can allow application to change the supported version of Data Classification from "1" up to maximum supported.
251+
Starting from 17.4.2.1, the default version of data classification is set to "1" and is the version the driver reports to SQL Server as supported. A new connection attribute `SQL_COPT_SS_DATACLASSIFICATION_VERSION` (1400) can allow application to change the supported version of Data Classification from "1" up to the maximum supported.
250252
251-
Example:
253+
Example:
252254
253-
To set the version this call should be made right before the SQLConnect or SQLDriverConnect call:
254-
```
255+
To set the version, this call should be made right before the SQLConnect or SQLDriverConnect call:
256+
257+
```cpp
255258
ret = SQLSetConnectAttr(dbc, SQL_COPT_SS_DATACLASSIFICATION_VERSION, (SQLPOINTER)2, SQL_IS_INTEGER);
256259
```
257260

258-
The value of the currently supported version of Data Classification can be retrieved via SQLGetConnectAttr call:
259-
```
261+
The value of the currently supported version of Data Classification can be retrieved via SQLGetConnectAttr call:
262+
263+
```cpp
260264
ret = SQLGetConnectAttr(dbc, SQL_COPT_SS_DATACLASSIFICATION_VERSION, (SQLPOINTER)&dataClassVersion, SQL_IS_INTEGER, 0);
261-
```
265+
```

0 commit comments

Comments
 (0)