1.How to create a dacpac file for the specific objects? 2. How to exclude specific objects from the dacpac.

Munshi, Akshay-XT 1 Reputation point

Could you please guide us with the below two points:

  1. How to create a dacpac file for the specific objects.
    e.g.: We are having 1000 tables in our source database and from those 1000 tables we need to create dacpac for only 50 tables.
  2. How to exclude specific objects from the dacpac.
    e.g.: We are having a dacpac file in that 1000 tables are available and we need to deploy or publish only 50 tables to the target database.
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,697 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Olaf Helper 40,741 Reputation points

    You can not, a DACPAC always presents the complete database, not single objects.
    See Data-tier Applications: A data-tier application (DAC) is a logical database management entity that defines all of the SQL Server objects

    Use the script wizard instead to script out single objects.
    Generate Scripts (SQL Server Management Studio)

    0 comments No comments

  2. Tom Phillips 17,716 Reputation points

    A dacpac represents an entire database from a project file. When you PUBLISH a dacpac, as a default it only changes objects which are different. If the objects are the same, they are skipped.

    0 comments No comments

  3. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor

    Hi MunshiAKshayXT-4232,

    Welcome to Microsoft Q&A.
    Agree with others. In addition, if you only want to import and export specific tables, you can create a .bacpac file, which can specify a subset of the tables to be exported. The export-import operations can be combined to migrate a DAC between instances, to create an archive, or to create an on-premise copy of a database deployed in SQL Database.
    Please refer to Export a Data-tier Application and Import a BACPAC File which might help.

    Best Regards,

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments