ISSDataClassification::GetSensitivityClassification

Applies to: SQL Server Azure SQL Database Azure Synapse Analytics

Download OLE DB driver

Retrieves sensitivity classification data for the active rowset. For more information and code sample, see Using data classification.

Syntax

HRESULT GetSensitivityClassification(
    SENSITIVITYCLASSIFICATION** ppSensitivityClassification);

Arguments

ppSensitivityClassification[out]
A pointer to a SENSITIVITYCLASSIFICATION structure pointer. If the method fails or there is no data classification information available, the provider doesn't allocate any memory, and ensures that the ppSensitivityClassification argument is a null pointer on output.

Return Code Values

S_OK
The method succeeded.

E_INVALIDARG
The ppSensitivityClassification argument was NULL.

E_OUTOFMEMORY
The OLE DB Driver for SQL Server couldn't allocate enough memory to complete the request.

Remarks

The OLE DB Driver for SQL Server allocates a block of memory to hold the SENSITIVITYCLASSIFICATION structure and the data referenced by this structure. When the consumer no longer requires access to the classification data, it must deallocate this memory by calling the IMalloc::Free method.

The SENSITIVITYCLASSIFICATION structure is defined as follows:

typedef struct tagSensitivityClassification
{
    USHORT                     cSensitivityLabels;
    SENSITIVITYLABEL          *rgSensitivityLabels;
    USHORT                     cInformationTypes;
    INFORMATIONTYPE           *rgInformationTypes;
    USHORT                     cColumnSensitivityMetadata;
    COLUMNSENSITIVITYMETADATA *rgColumnSensitivityMetadata;
    SENSITIVITYRANKENUM        eQuerySensitivityRank;
} SENSITIVITYCLASSIFICATION;
Member Description
cSensitivityLabels The number of SENSITIVITYLABEL structures in rgSensitivityLabels.
rgSensitivityLabels An array of SENSITIVITYLABEL structures.
cInformationTypes The number of INFORMATIONTYPE structures in rgInformationTypes.
rgInformationTypes An array of INFORMATIONTYPE structures.
cColumnSensitivityMetadata The number of COLUMNSENSITIVITYMETADATA structures in rgColumnSensitivityMetadata.
rgColumnSensitivityMetadata An array of COLUMNSENSITIVITYMETADATA structures.
eQuerySensitivityRank A relative ranking of the sensitivity of a query that was executed to obtain the rowset.

The SENSITIVITYLABEL structure is defined as follows:

typedef struct tagSENSITIVITYLABEL
{
    LPOLESTR pwszName;
    LPOLESTR pwszId;
} SENSITIVITYLABEL;
Member Description
pwszName The name for a sensitivity label.
pwszId The identifier for a sensitivity label.

The INFORMATIONTYPE structure is defined as follows:

typedef struct tagINFORMATIONTYPE
{
    LPOLESTR pwszName;
    LPOLESTR pwszId;
} INFORMATIONTYPE;
Member Description
pwszName The name for an information type.
pwszId The identifier for an information type.

The COLUMNSENSITIVITYMETADATA structure is defined as follows:

typedef struct tagCOLUMNSENSITIVITYMETADATA
{
    SENSITIVITYPROPERTY* rgSensitivityProperties;
    USHORT cSensitivityProperties;
} COLUMNSENSITIVITYMETADATA;
Member Description
cSensitivityProperties The number of SENSITIVITYPROPERTY structures in rgSensitivityProperties.
rgSensitivityProperties An array of SENSITIVITYPROPERTY structures.

The SENSITIVITYRANKENUM enum is defined as follows:

typedef enum tagSENSITIVITYRANKENUM
{
    SENSITIVITYRANK_NOT_DEFINED = -1,
    SENSITIVITYRANK_NONE = 0,
    SENSITIVITYRANK_LOW = 10,
    SENSITIVITYRANK_MEDIUM = 20,
    SENSITIVITYRANK_HIGH = 30,
    SENSITIVITYRANK_CRITICAL = 40
} SENSITIVITYRANKENUM;

The SENSITIVITYPROPERTY structure is defined as follows:

typedef struct tagSENSITIVITYPROPERTY
{
    SENSITIVITYLABEL* pSensitivityLabel;
    INFORMATIONTYPE* pInformationType;
    SENSITIVITYRANKENUM eSensitivityRank;
} SENSITIVITYPROPERTY;
Member Description
pSensitivityLabel A pointer to a SENSITIVITYLABEL structure.
pInformationType A pointer to an INFORMATIONTYPE structure.
eSensitivityRank A relative ranking of the sensitivity of a column that is part of per-column data.

See Also

ISSDataClassification
Rowsets