How to List all Contained Databases in a SQL Server Instance

Contained Databases feature is introduced in SQL Server 2012.

To list all Contained Databases in a SQL Server instance, run the following code:

SELECT name, containment, containment_desc
FROM sys.databases
WHERE containment <> 0;


In Options tab od Database Properties window, you can see the Database Containment type:


If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">