Modified Features (Contained Database)
Applies to: SQL Server (all supported versions) Azure SQL Managed Instance
The following features have been modified to be supported by a partially contained database. Features are usually modified so they do not cross the database boundary.
For more information, see Contained Databases.
When using the ALTER DATABASE statement from inside of a contained database, the syntax differs from that used for a non-contained database. This difference includes restrictions of elements of the statement that extend beyond the database to the instance. For more information, see ALTER DATABASE (Transact-SQL).
The syntax for the ALTER DATABASE when used outside of a contained database differs from that used for non-contained databases. These changes prevent crossing the database boundary. For more information, see ALTER DATABASE (Transact-SQL).
The CREATE DATABASE syntax for a contained database differs from that for a non-contained database. See CREATE DATABASE (SQL Server Transact-SQL)for information about new syntax requirements and allowances.
Local temporary tables are permitted within a contained database, but their behavior differs from those in non-contained databases. In non-contained databases, temporary table data is collated in the collation of tempdb. In a contained database temporary table data is collated in the collation of the contained database.
All metadata associated with temporary tables (for example, table and column names, indexes, and so on) will be in the catalog collation.
Named constraints may not be used in temporary tables.
Temporary tables may not refer to user-defined types, XML schema collections, or user-defined functions.
In the non-contained database model, there are three separate types of collation: Database collation, Instance collation, and tempdb collation. Contained databases use only two collations, database collation and the new catalog collation. See Contained Database Collations for more details on contained database collation.
When enabling contained databases, the user options Option must be set to 0 for the instance of SQL Server.
Submit and view feedback for