Skip to main content

DatabaseDeploy

The DatabaseDeploy utility is used to create a new database or to update an existing database to the latest version.

note

You can also run the utility in a batch of commands. If the database creation/upgrade is successful, the return code returns 0, if it fails, it returns 1.

Command line syntax

DatabaseDeploy.exe /conn*<connection string>/langid<language id>*

Parameters

ParameterDescription
/conn <chain>

The connection string to the database.

Note: the database name is also set in the connection string.

/langid <language id>

ID of the database language. Supported values:

  • 1029 - Czech
  • 1051 - Slovak
  • 1033 - English
  • 1031 - German
  • 1045 - Polish

Note: this parameter is only applied when creating a new database.

/collation

Collation of the new database, if not specified, will use the default collation of the database server.

/multitenant

Connect to the tenant database and deploy all the databases or create a new empty tenant database. See Multitenant mode.

note
  • You can also set command line parameters in the appsettings.json file. The command line parameters take precedence over the settings in the configuration file.
  • The utility expects the Alvao database definition file AlvaoDatabase.dacpac to exist in the same folder.

Examples

  1. Create a new Czech database named "ALVAO" on a local computer with SQL Server with instance name "sqlexpress" using integrated Windows authentication:
DatabaseDeploy.exe /conn "Data Source=.\sqlexpress;Initial Catalog=ALVAO; Integrated Security=True;TrustServerCertificate=True" /langid 1029
  1. Upgrade database named "ALVAO" to SQL server on server "SERVER1" using SQL username and password:
DatabaseDeploy.exe /conn "Data Source=SERVER1,1433;Initial Catalog=ALVAO;User ID=user1234;Password=secret1234;TrustServerCertificate=True"
  1. Upgrade all databases in a multitenant environment:
DatabaseDeploy.exe /conn "Data Source=.\sqlexpress;Initial Catalog=AlvaoTenants;Integrated Security=True;TrustServerCertificate=True" /multitenant
note

For more connection string examples, see Connection String Examples.