DatabaseLink`
DatabaseLink`

SQLTablePrimaryKeys

SQLTablePrimaryKeys[conn,table]

returns information about the columns comprising the primary key of table.

Details and Options

  • To use SQLTablePrimaryKeys, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • The following options can be given:
  • "Catalog"Nonedatabase catalog to use
    "Schema"Nonedatabase schema to use
    "ShowColumnHeadings"Falsewhether to return headings with the results

Examples

Basic Examples  (1)

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.

Open a connection:

Create a table with a primary key:

Fetch primary key information for this table: