Last modified: January 09, 2012
Applies to: Windows | Windows Server
The JetCreateTableColumnIndex3 function creates a table in an ESE database with an initial set of indexes and an initial set of columns from an array of JET_TABLECREATE3 structures. The JET_TABLECREATE3 structure allows a callback function to be specified.
Windows 7: JetCreateTableColumnIndex3 is introduced in the Windows 7 operating system.
JET_ERR JET_API JetCreateTableColumnIndex3( __in JET_SESID sesid, __in JET_DBID dbid, __in_out JET_TABLECREATE3* ptablecreate );
The database session context to use for the API call.
The database identifier to use for the API call.
This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.
The operation completed successfully.
The callback function could not be resolved. The DLL might not have been found, or the function in the DLL might not have been found. With sufficient logging enabled, the event log will provide more details.
An attempt was made to index over an escrow-update or SLV column (note that SLV columns are deprecated).
If ptablecreate->grbit specifies JET_bitTableCreateTemplateTable, but ptablecreate->szTemplateTableName is set to NULL.
A column already exists.
An attempt was made to index over a non-existent column. Attempting to conditionally index over a non-existent column can also produce this error.
An attempt was made to add a redundant column. There should be no more than one autoincrement column, and no more than one version column per table.
This error will be returned if the ulDensity member of the JET_INDEXCREATE2 structure is set to a number less than 20 or more than 100.
Signifies that the table named in the szTemplateTableName member of the JET_TABLECREATE3 structure was not marked as a template table (that is, that table did not have JET_bitTableCreateTemplateTable set).
An attempt to define two identical indexes was made.
An attempt was made to specify more than one primary index for a table. A table must have exactly one primary index. If no primary index is specified, the database engine will transparently create one.
An invalid index definition was specified. The following are some of the possible reasons for receiving this error:
Windows XP and later versions of Windows. A tuple index cannot be unique (that is, the grbit member of the JET_INDEXCREATE2 structure must not have both JET_bitIndexPrimary and JET_bitIndexUnique set).
Windows XP and later versions of Windows. A tuple index can only be over a single column (that is, if the grbit member of the JET_INDEXCREATE2 structure has JET_bitIndexTuples set, and the szKey member of the JET_INDEXCREATE2 structure specifies more than one column).
Windows XP and later versions of Windows. A tuple index cannot be a primary index (that is, the grbit member of the JET_INDEXCREATE2 structure must not have both JET_bitIndexPrimary and JET_bitIndexTuples set).
Windows XP and later versions of Windows. A tuple index can only be on a text or Unicode column. An attempt to index other columns (such as binary columns) will result in JET_errIndexTuplesTextColumnsOnly.
Windows XP and later versions of Windows. A tuple index does not allow the cbVarSegMac member of the JET_INDEXCREATE2 structure to be set.
An attempt was made to create an index without version information while in a transaction.
The cp member of the JET_COLUMNCREATE structure was not set to a valid code page. The only valid values for text columns are English (1252) and Unicode (1200). A value of 0 means the default will be used (English, 1252).
The coltyp member of the JET_COLUMNCREATE structure was not set to a valid column type.
The following are some reasons why this error may occur:
An invalid combination of grbit members was specified in JET_TABLECREATE3.
The index definition is invalid because the grbit member contains inconsistent values. The following are some possible reasons:
An invalid Locale ID (LCID) was passed in (either through the lcid member of the JET_UNICODEINDEX structure which is pointed to by the pidxunicode member in the JET_INDEXCREATE2 structure, or through the lcid field of the JET_INDEXCREATE2 structure).
An invalid parameter was given. The following are some possible reasons:
The record is too big. The sum of the cbMax member of the JET_COLUMNCREATE structure for all fixed columns must not exceed a certain value.
The table already exists.
An attempt was made to add too many columns to the table. A table can have no more than JET_ccolFixedMost fixed columns, no more than JET_ccolVarMost variable-length columns, and no more than JET_ccolTaggedMost tagged columns.
An error occurred attempting to normalize a Unicode column. This can be caused by running out of system resources.
An element of the JET space hints structure was not correct or actionable.
The name JetCreateTableColumnIndex3 comes from the order of creation of the objects: It first creates a table, columns, and then finally indexes. JetCreateTableColumnIndex3 creates a table with an initial set of columns and indexes. Additional columns and indexes can be added and removed dynamically with JetAddColumn, JetDeleteColumn, JetDeleteColumn2, JetCreateIndex, JetCreateIndex2, JetCreateIndex3, and JetDeleteIndex.
Requires Windows Vista or Windows XP.
Requires Windows Server 2008 or Windows Server 2003.
Declared in Esent.h.
Implemented as JetCreateTableColumnIndex3W (Unicode) and JetCreateTableColumnIndex3A (ANSI).