question

MunshiAkshayXT-4232 avatar image
0 Votes"
MunshiAkshayXT-4232 asked AmeliaGu-msft answered

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

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-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered

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)


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered

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,
Amelia


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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.