The adSchemaColumns QueryType identifies the columns of tables defined in the catalog that are accessible to a given user. The rowset returned by an adSchemaColumns QueryType contains the following columns:
Column name | Type indicator | Description |
---|---|---|
TABLE_CATALOG | DBTYPE_WSTR | Catalog name. NULL if the provider does not support catalogs. |
TABLE_SCHEMA | DBTYPE_WSTR | Unqualified schema name. NULL if the provider does not support schemas. |
TABLE_NAME | DBTYPE_WSTR | Table name. |
COLUMN_NAME | DBTYPE_WSTR | The name of the column; this might not be unique. If this cannot be determined, a NULL is returned. This column, together with the COLUMN_GUID and COLUMN_PROPID columns, forms the column ID. One or more of these columns will be NULL depending on which elements of the DBID structure the provider uses. If possible, the resulting column ID should be persistent. However, some providers do not support persistent identifiers for columns. The column ID of a base table should be invariant under views. |
COLUMN_GUID | DBTYPE_GUID | Column GUID. |
COLUMN_PROPID | DBTYPE_UI4 | Column property ID. |
ORDINAL_POSITION | DBTYPE_UI4 | The ordinal of the column. Columns are numbered starting from one. NULL if there is no stable ordinal value for the column. |
COLUMN_HASDEFAULT | DBTYPE_BOOL | VARIANT_TRUE: The column has a default value. VARIANT_FALSE: The column does not have a default value or it is unknown whether the column has a default value. |
COLUMN_DEFAULT | DBTYPE_WSTR | Default value of the column. A provider may expose DBCOLUMN_DEFAULTVALUE but not DBCOLUMN_HASDEFAULT (for SQL 92 tables) in the rowset returned by IColumnsRowset::GetColumnsRowset. If the default value is the NULL value, COLUMN_HASDEFAULT is VARIANT_TRUE, and the COLUMN_DEFAULT column is a NULL value. |
COLUMN_FLAGS | DBTYPE_UI4 | A bitmask that describes column characteristics. The DBCOLUMNFLAGS enumerated type specifies the bits in the bitmask. For information about DBCOLUMNFLAGS, see IColumnsInfo::GetColumnInfo. This column cannot contain a NULL value. |
IS_NULLABLE | DBTYPE_BOOL | VARIANT_TRUE: The column might be nullable. VARIANT_FALSE: The column is known not to be nullable. |
DATA_TYPE | DBTYPE_UI2 | The indicator of the column's data type. If the data type of the column varies from row to row, this must be DBTYPE_VARIANT. For a list of valid type indicators, see "Type Indicators" in Appendix A. |
TYPE_GUID | DBTYPE_GUID | The GUID of the column's data type. |
CHARACTER_MAXIMUM_LENGTH | DBTYPE_UI4 | The maximum possible length of a value in the column. For character, binary, or bit columns, this is one of the following:· |
CHARACTER_OCTET_LENGTH | DBTYPE_UI4 | Maximum length in octets (bytes) of the column, if the type of the column is character or binary. A value of zero means the column has no maximum length. NULL for all other types of columns. |
NUMERIC_PRECISION | DBTYPE_UI2 | If the column's data type is numeric, this is the maximum precision of the column. The precision of columns with a data type of DBTYPE_DECIMAL or DBTYPE_NUMERIC depends on the definition of the column. For the precision of all other numeric data types, see "Precision of Numeric Data Types" in Appendix A. If the column's data type is not numeric, this is NULL. |
NUMERIC_SCALE | DBTYPE_I2 | If column's type indicator is DBTYPE_DECIMAL or DBTYPE_NUMERIC, this is the number of digits to the right of the decimal point. Otherwise, this is NULL. |
DATETIME_PRECISION | DBTYPE_UI4 | Datetime precision (number of digits in the fractional seconds portion) of the column if the column is a datetime or interval type. |
CHARACTER_SET_CATALOG | DBTYPE_WSTR | Catalog name in which the character set is defined. NULL if the provider does not support catalogs or different character sets. |
CHARACTER_SET_SCHEMA | DBTYPE_WSTR | Unqualified schema name in which the character set is defined. NULL if the provider does not support schemas or different character sets. |
CHARACTER_SET_NAME | DBTYPE_WSTR | Character set name. NULL if the provider does not support different character sets. |
COLLATION_CATALOG | DBTYPE_WSTR | Catalog name in which the collation is defined. NULL if the provider does not support catalogs or different collations. |
COLLATION_SCHEMA | DBTYPE_WSTR | Unqualified schema name in which the collation is defined. NULL if the provider does not support schemas or different collations. |
COLLATION_NAME | DBTYPE_WSTR | Collation name. NULL if the provider does not support different collations. |
DOMAIN_CATALOG | DBTYPE_WSTR | Catalog name in which the domain is defined. NULL if the provider does not support catalogs or domains. |
DOMAIN_SCHEMA | DBTYPE_WSTR | Unqualified schema name in which the domain is defined. NULL if the provider does not support schemas or domains. |
DOMAIN_NAME | DBTYPE_WSTR | Domain name. NULL if the provider does not support domains. |
DESCRIPTION | DBTYPE_WSTR | Human-readable description of the column. For example, the description for a column named Name in the Employee table might be "Employee name." |
The default sort order for the adSchemaColumns rowset is TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME.