Editja

Create a database from a DACPAC or BACPAC in SQL Server Management Studio

Use Create database from bacpac/dacpac to create an empty database with the New Database dialog, then apply a .dacpac or .bacpac file with the Apply wizard.

Note

The Create database from bacpac/dacpac command is in preview.

Prerequisites

This command uses the existing New Database dialog. It isn't available for Azure SQL Database. To apply a package to an existing Azure SQL Database, use Apply a DACPAC or BACPAC to an existing database.

Create the database

  1. In Object Explorer, right-click the Databases folder and select Create database from bacpac/dacpac (Preview).

    Screenshot of the Databases context menu showing Create database from bacpac/dacpac in preview.

  2. In the New Database dialog, enter the Database name. Configure the owner, database files, options, and filegroups as needed.

    Important

    Select the same collation as defined in the bacpac/dacpac file.

    Screenshot of the New Database dialog showing the database name, owner, and database files.

  3. Select OK to create the database. When creation succeeds, the Apply wizard opens with the new database selected as the target.

Apply the package

In the Apply wizard, select Bacpac or Dacpac, and enter the local file path or select Browse.

Screenshot of the Apply wizard with the newly created database as the target and Bacpac selected.

The remaining steps are the same as Apply a DACPAC or BACPAC to an existing database.

Note

Database creation and package application are separate operations. If you cancel the Apply wizard or the package application fails, the created database remains.