ColumnMetadata object

A ColumnMetadata object contains all the information known about a column in a row.


Full documentation for the meaning of these properties is available in the Microsoft docs.

  • string columnName: the name of the column, as specified in the select statement (i.e. this will be column alias if there is one)

  • string tableName: the name of the table containing this column. Caution: this is usually null, as SQL Server rarely returns that information

  • int userType: the user type, normally 0 unless this is a user-defined data type

  • boolean fNullable: true if the column is nullable

  • boolean fCaseSen: true if the column is case-sensitive

  • byte usUpdateable: 0 if the column is read-only, 1 if it's read/write, and 2 if it's unknown

  • boolean fIdentity: true if the column is an identity column

  • boolean fComputed: true if the column is computed, as opposed to stored in the database

  • boolean fFixedLenCLRType: true if the column has a common language runtime user-defined type

  • boolean fSparseColumnSet: true if this column is the special XML column column in a sparse column set

  • boolean fEncrypted: true if the column value is encrypted, and therefore needs to be decrypted by the client

  • boolean fHidden: true if the column is part of a hidden primary key created to support a select statement for browse

  • boolean fKey: true if the column is part of the primary key and the select statement is for browse

  • boolean fNullableUnknown: true if it's unknown whether the column is nullable or not

  • TypeInfo typeInfo: the TypeInfo for the column

  • CryptoMetadata cryptoMetadata: if this column is encrypted, the information about the encryption (see below for details)

CryptoMetadata object

Full documentation is available in the Microsoft docs.

  • int userType: the user type, if relevant

  • TypeInfo baseTypeInfo: the base type info

  • byte encryptionAlgorithm: the algorithm used for this column. 0 means custom algorithm, 1 is AEAD_AES_256_CBC_HMAC_SHA512, 2 is AEAD_AES_256_CBC_HMAC_SHA256

  • string algorithmName: the name of the algorithm in use for this column

  • byte encryptionAlgorithmType: a value of 1 indicates a deterministic algorithm, 2 indicates randomized encryption

  • byte normVersion: the normalization version to which plaintext data must be normalized (1-based)