SQLTableIndexInformation[conn]
returns a table of indices and statistics for a table.
更多信息和选项
范例
基本范例
参见
技术笔记
相关指南
DatabaseLink`
DatabaseLink`
SQLTableIndexInformation
SQLTableIndexInformation[conn]
returns a table of indices and statistics for a table.
更多信息和选项
- To use SQLTableIndexInformation, you first need to load DatabaseLink using Needs["DatabaseLink`"].
- The following options can be given:
-
"Catalog" None database catalog to use "Schema" None database schema to use "ShowColumnHeadings" False whether to return headings with the results
范例
基本范例 (1)
Needs["DatabaseLink`"]If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the DatabaseLink`DatabaseExamples` package, as described in Using the Example Databases.
Create a table with a primary key and an index column:
conn = OpenSQLConnection["demo"];SQLCreateTable[conn, SQLTable["TEST1"], {SQLColumn["id", "DataTypeName" -> "Integer", "PrimaryKey" -> True], SQLColumn["Name", "DataTypeName" -> "VARCHAR", "DataLength" -> 255]},
"Index" -> "Name"]Both columns appear as table indices:
SQLTableIndexInformation[conn, "TEST1", "ShowColumnHeadings" -> True]//TableFormSQLDropTable[conn, "TEST1"];CloseSQLConnection[conn];