Search code examples
dacpacsqlpackage

Determine Target SQL Platform from a dacpac


Is it possible to determine the Target Platform that was used when creating a dacpac. I've looked at all of the parameters for SqlPackage.exe and none of them seem to give this information. Ideally I'd like to be able to determine this from the command line but if there was some way of determining it from Visual Studio as well, that would be fine.


Solution

  • The simplest way to figure out the target platform of a given dacpac is to unzip it and look at the model.xml file inside. There will be a "DatabaseSchemaProvider" specified in the XML, which will be one of these:

    • Sql90DatabaseSchemaProvider - SQL Server 2005
    • Sql100DatabaseSchemaProvider - SQL Server 2008
    • Sql110DatabaseSchemaProvider - SQL Server 2012
    • Sql120DatabaseSchemaProvider - SQL Server 2014
    • Sql130DatabaseSchemaProvider - SQL Server 2016
    • Sql140DatabaseSchemaProvider - SQL Server vNext
    • SqlAzureDatabaseSchemaProvider - Azure SQL Database
    • SqlAzureV12DatabaseSchemaProvider - Azure SQL Database V12