Invantive UniversalSQL Server tells a SQL Server compatible client which columns identify a row and which tables relate to each other. A client such as Microsoft Power BI can use this to propose relationships, Microsoft SQL Server Management Studio shows the keys in the Object Explorer and in the table designer, and a client that uses ODBC reads them with `SQLPrimaryKeys`, `SQLStatistics` and `SQLForeignKeys`. The keys are not made up by Invantive UniversalSQL Server. A [[Invantive UniversalSQL/General/Data Containers|data container]] states them for its tables, and a data container which states none has none to show. ## Primary Keys A primary key has one column or several columns in key order. It is published as the constraint `PK_<table>` and as a unique, non-clustered index of the same name. The columns of a primary key are not nullable. The statements of Power BI that list keys answer the primary keys from release 27.0. The ODBC functions `SQLPrimaryKeys` and `SQLStatistics` and the key lists of Microsoft SQL Server Management Studio answered them before. ## Unique Keys A unique key is a set of columns that identifies a row besides the primary key. It is published as a unique constraint with a unique, non-clustered index. Management Studio lists it as a unique key, `SQLStatistics` lists it as an index after the primary key, and the key statement of Power BI lists it with the primary key. Available from release 28.0. When the data container gives a key no name, or the same name as another key in the schema, the name is made from the table and the columns, such as `UQ_customers_email`. ## Foreign Keys A foreign key links the columns of one table to the key of another table of the same data container. It is published as a foreign key constraint, with these properties: - The rules for update and delete are `NO ACTION`, and the key is not deferrable. - A foreign key which the data container declares and the platform does not enforce is marked as not trusted, as Microsoft SQL Server does for a constraint it does not check. - The foreign key names the primary key or unique key of the referenced table when the referenced columns are that key. - A foreign key to a table that cannot be found, or that more than one table answers to, is left out. Only a relation which holds for every row is published as a foreign key. A relation which holds under a condition, and a relation which only follows from the names of the columns, stay out, since a SQL Server client reads every foreign key as a promise. The [[Invantive MCP Server/Tools|MCP Server]] reports those relations to an AI client together with the sentence that says when they hold. The foreign keys are read by `SQLForeignKeys`, by the foreign key lists and the table designer of Management Studio, by Sumatra and by the relationship statements of Power BI. Available from release 28.0. ## Not Published The OData 4 interface of Bridge Online does not publish foreign keys. A client that needs the relations reads them through Invantive UniversalSQL Server.