Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h1>From within SQL Server Management Studio</h1> <p><em>From <a href="http://msdn.microsoft.com/en-us/library/ee210574.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ee210574.aspx</a></em></p> <p>To view the details of a DAC deployed to an instance of the Database Engine:</p> <ol> <li><p>Select the <strong>View/Object Explorer</strong> menu.</p></li> <li><p>Connect to the instance of the from the <strong>Object Explorer</strong> pane.</p></li> <li><p>Select the <strong>View/Object Explorer Details</strong> menu.</p></li> <li><p>Select the server node in <strong>Object Explorer</strong> that maps to the instance, and then navigate to the <strong>Management\Data-tier Applications</strong> node.</p></li> <li><p>The list view in the top pane of the details page lists each DAC deployed to the instance of the Database Engine. Select a DAC to display the information in the detail pane at the bottom of the page.</p></li> </ol> <p>The right-click menu of the Data-tier Applications node is also used to deploy a new DAC or delete an existing DAC.</p> <h1>Via a SQL statement</h1> <pre><code>SELECT instance_name, type_version FROM msdb.dbo.sysdac_instances </code></pre> <h1>Via a SQL statement on Azure</h1> <pre><code>SELECT instance_name, type_version FROM master.dbo.sysdac_instances </code></pre> <h1>Programmatically using .NET code</h1> <p>Note that in DacFx 3.0 this is no longer valid. See my other answer for a way to do it.</p> <h3>C#</h3> <pre class="lang-cs prettyprint-override"><code>ServerConnection serverConnection; string databaseName; // Establish a connection to the SQL Server instance. using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) { serverConnection = new ServerConnection(sqlConnection); serverConnection.Connect(); // Assumes default database in connection string is the database we are trying to query. databaseName = sqlConnection.Database; } // Get the DAC info. DacStore dacstore = new DacStore(serverConnection); var dacInstance = dacstore.DacInstances[databaseName]; System.Diagnostics.Debug.Print("Database {0} has Dac pack version {1}.", databaseName, dacInstance.Type.Version); </code></pre> <h3>VB.NET</h3> <pre class="lang-vb prettyprint-override"><code>Dim serverConnection As ServerConnection Dim databaseName As String ' Establish a connection to the SQL Server instance. Using sqlConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString) serverConnection = New ServerConnection(sqlConnection) serverConnection.Connect() ' Assumes default database in connection string is the database we are trying to query. databaseName = sqlConnection.Database End Using ' Get the DAC info. Dim dacstore As New DacStore(serverConnection) Dim dacInstance = dacstore.DacInstances(databaseName) System.Diagnostics.Debug.Print("Database {0} has Dac pack version {1}.", databaseName, dacInstance.Type.Version) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload