SQLPAckage Export function to export all tables from only one Schema

sachin gupta 376 Reputation points
2022-05-30T18:32:48.217+00:00

Hi Team,
I am trying to Export the schema and data from Azure SQL Database to blob storage. I used the SqlPackage Export function to export the .bacpac file which works for all the schemas present in the database, but I need to export only tables which belongs to one schema only.

SQL DB1- dbo schema.
Table Names:
dbo.x1
dbo.x2,
......................................................................

SQL DB1 - stage1 schema
Table Names:
stage1.y1
stage2.y2

As per above example I want to export all tables from dbo schema only, not stage1 schema. I know SqlPackage has option /p: TableData=[list of table names], but I do not want to explicitly mention name of the tables, however I want to export all tables under dbo schema.

Please share your valuable suggestion on this. I would Highly appreciate your help and support.

Thanks

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ronen Ariely 15,216 Reputation points
    2022-05-31T01:18:30.177+00:00

    Hi @sachin gupta

    The simplest option is to use SQL Server Management Studio since it provide a graphical interface which allow you to select which exact resources you want to add to your export

    206828-image.png

    Behind the scenes this execute the utility SQLPAckage but it provide a simple GUI

    After you fill the setting, go to the advance tab

    Here you can do exactly what you asked for: select which schema you want to add to the bacpac file

    206810-image.png


Your answer

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