DatabaseLink`
DatabaseLink`

SQLColumnPrivileges

SQLColumnPrivileges[conn]

returns a table of access rights for the columns in an SQL connection.

SQLColumnPrivileges[conn,table]

returns a table pertaining to the columns in table.

SQLColumnPrivileges[conn,SQLTable[table]]

returns a table pertaining to the columns in table.

SQLColumnPrivileges[conn,{table,column}]

returns a table pertaining to the columns in table matching column.

SQLColumnPrivileges[conn,SQLColumn[{table,column}]]

returns a table pertaining to the columns in table matching column.

SQLColumnPrivileges[conn,SQLColumn[column]]

returns a table pertaining to the columns in any table matching column.

Details and Options

  • To use SQLColumnPrivileges, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • Table and column specifications may include SQL wildcards.
  • 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:

Get {table,column} pairs for a particular table:

Restrict results to a particular column: