Partager via


Schema Rowset Classes and Typedef Classes

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Schema Rowset Classes and Typedef Classes.

A schema is a collection of database objects that are owned, or have been created by, a particular user. A catalog can contain one or more schemas, but must always contain a schema called INFORMATION_SCHEMA, which contains the views and domains of the information schema. Schema information in OLE DB is retrieved using predefined schema rowsets, and includes types, tables, columns, indexes, views, assertions and constraints, statistics, character sets, collations, and domains.

Schema rowsets are predefined rowsets representing metadata. Schema rowsets are generally used in dynamic programming, where the database structure is not known at compile time. You can use these schema rowsets to obtain information about a database at run time.

Use the typedef classes to instantiate the schema rowsets. The corresponding typedef and schema rowset classes are listed below. You must call CRestrictions::Open after you have created an instance of the schema rowset. This method returns a result set based on the restrictions you specify. See IDBSchemaRowset for information on restriction columns associated with each schema rowset.

The following table displays each OLE DB Schema Rowset and its corresponding OLE DB Templates typedef class and info class.

OLE DB Schema Rowset Typedef class Info class
ASSERTIONS CAssertions CAssertionInfo
CATALOGS CCatalogs CCatalogInfo
CHARACTER_SETS CCharacterSets CCharacterSetInfo
COLLATIONS CCollations CCollationInfo
COLUMN_PRIVILEGES CColumnPrivileges CColumnPrivilegeInfo
COLUMNS CColumns CColumnsInfo
CONSTRAINT_COLUMN_USAGE CConstraintColumnUsage CConstraintColumnUsageInfo
CONSTRAINT_TABLE_USAGE CConstraintTableUsage CConstraintTableUsageInfo
CHECK_CONSTRAINTS CCheckConstraints CCheckConstraintInfo
COLUMN_DOMAIN_USAGE CColumnDomainUsage CColumnDomainUsageInfo
FOREIGN_KEYS CForeignKeys CForeignKeysInfo
INDEXES CIndexes CIndexInfo
KEY_COLUMN_USAGE CKeyColumnUsage CKeyColumnUsageInfo
PRIMARY_KEYS CPrimaryKeys CPrimaryKeyInfo
PROCEDURES CProcedures CProcedureInfo
PROCEDURE_COLUMNS CProcedureColumns CProcedureColumnInfo
PROCEDURE_PARAMETERS CProcedureParameters CProcedureParameterInfo
PROVIDER_TYPES CProviderTypes CProviderInfo
REFERENTIAL_CONSTRAINTS CReferentialConstraints CReferentialConstraintInfo
SCHEMATA CSchemata CSchemataInfo
SQL_LANGUAGES CSQLLanguages CSQLLanguageInfo
STATISTICS CStatistics CStatisticInfo
TABLE_CONSTRAINTS CTableConstraints CTableConstraintInfo
TABLES CTables CTableInfo
TABLE_PRIVILEGES CTablePrivileges CTablePrivilegeInfo
TRANSLATIONS CTranslations CTranslationInfo
USAGE_PRIVILEGES CUsagePrivileges CUsagePrivilegeInfo
VIEW_COLUMN_USAGE CViewColumnUsage CViewColumnInfo
VIEWS CViews CViewInfo
VIEW_TABLE_USAGE CViewTableUsage CViewTableInfo

Requirements

Header: atldbsch.h

See Also

CRestrictions Class