Why Partially Contained Databases and What Are Partially Contained?

What and Why?

When contained database was first introduced in SQL Server 2012 (Denali), SQL Server databases can become free of external dependencies on server-level metadata and settings, including login details. Thanks to the new database containment feature, DBAs finally get help dealing with the age-old problem of orphaned users.

There are three types of containment hinted at in SQL Server 2012 Books Online (BOL):
  • NONE. This default containment mode is what exists prior to SQL Server 2012. There are no boundaries defined or visible.
  • PARTIAL. With partially contained databases, you have the ability to define clearer boundaries between databases and the server, making it easier for metadata to be hosted within the databases. This, in turn, makes SQL Server databases more portable and less dependent on underlying hosts.
  • FULL. Fully contained databases are only alluded to in SQL Server 2012 BOL in a few locations and aren't currently available as an option. It's assumed, however, that full containment will enable greater database portability and potentially allow for strict enforcement of containment boundaries as a means of fully isolating databases from each other and from the underlying host.
However, the fully contained database features were not available. Even now, the fully contained functionality is not ready yet by SP1 (3339).

What are not contained?
Think about this way: what you cannot or should not do with the partially contained databases at this point. Following is a short list:

* Numbered procedures (a deprecated feature, several SPs with the same name but with different numbers)
* Schema-bound objects that depend on built-in functions with collation changes
* Binding change resulting from collation changes, including references to objects, columns, symbols, or types
* Replication, change data capture, and change tracking

-In addition, not all available features are contained for a particular application or database.

You can use the sys.dm_db_uncontained_entities and sys.sql_modules catalog views to find out info about the uncontained objects or features. Through these views, you can determine the containment status of applications and work out which objects or features you must replace or modify when transitioning to a more fully contained database.

What does it mean?

It means that we are actually working with the partially contained databases for now. The fully contained databases may be available in a future release.