how to extract dacpac to schema objects programmatically

SKG 66 Reputation points
2023-07-06T16:01:22.55+00:00

HI All,

I have a dacpac. I would like to extract tables, views and all other schema objects.

Is there a function in sqlpackage, which can accomplish this task.

TIA

Azure SQL Database
Developer technologies ASP.NET ASP.NET Core
Developer technologies Visual Studio Other
SQL Server Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-07-06T16:30:03.42+00:00

    just change the file extension to .zip, and unzip. you will see all the xml files

    0 comments No comments

  2. SKG 66 Reputation points
    2023-07-06T21:00:52.4966667+00:00

    Thanks, Bruce. I am seeing 4 xml files. I am expecting to see same folder structure as we see when we open in vs.net

    views,stored proc, tables etc

    Origin.xml

    Model.xml

    DacMetadata.xml

    ContentTypes.xml

    Thank you!


  3. SSingh-MSFT 16,371 Reputation points Moderator
    2023-07-07T04:30:09.14+00:00

    Hi SKG •,

    Thanks for posting this question on Microsoft Q&A forum.

    As I understand, you want to extract dacpac.

    Please refer to https://stackoverflow.com/questions/57402985/how-do-i-extract-a-database-schema-from-a-dacpac-file

    and

    https://learn.microsoft.com/en-us/azure/azure-sql/database/database-import?view=azuresql-mi&tabs=azure-powershell

    You can extract it using SSMS or Import in Azure Portal. Do let us know if you face any issue. Thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.