property for dropping specific table in target sqlpackage.exe

Abhinay 51 Reputation points
2022-08-29T10:21:01.197+00:00

Is there any property for dropping specific table in target (sqlpackage.exe)

I have add following properties in my publish report
/p:DropObjectsNotInSource=True
/p:DoNotDropTables=True

and I want to drop a specific table in target, is there any way I pass table name and the table get drop from target ?

Azure SQL 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,675 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

2 additional answers

Sort by: Most helpful
  1. Olaf Helper 40,736 Reputation points
    2022-08-29T11:19:28.9+00:00

    No, it is not possible to delete / exclude single objects.

    0 comments No comments

  2. NikoXu-msft 1,911 Reputation points
    2022-08-30T06:11:45.047+00:00

    Hi @AbhiY-4691 ,

    Individual objects cannot be deleted in sqlpackage.
    SqlPackage.exe is a command-line utility that automates the following database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs:
    Version: Returns the build number of the SqlPackage application. Added in version 18.6.
    Extract: Creates a data-tier application (.dacpac) file containing the schema or schema and user data from a connected SQL database.
    Publish: Incrementally updates a database schema to match the schema of a source .dacpac file. If the database does not exist on the server, the publish operation creates it. Otherwise, an existing database is updated.
    Export: Exports a connected SQL database - including database schema and user data - to a BACPAC file (.bacpac).
    Import: Imports the schema and table data from a BACPAC file into a new user database.
    DeployReport: Creates an XML report of the changes that would be made by a publish action.
    DriftReport: Creates an XML report of the changes that have been made to a registered database since it was last registered.
    Script: Creates a Transact-SQL incremental update script that updates the schema of a target to match the schema of a source.
    The SqlPackage.exe command line tool allows you to specify these actions along with action-specific parameters and properties.

    Best regards
    Niko

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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