Skip to main content

DatabaseDeploy

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

The utility return code is 0 if it succeeded, and 0 if it failed.

Command line parameters​

  • /conn <db connection string> - The connection string to the database that should be created or upgraded. See database connection string examples.

  • /langid <language id> - ID of the Alvao system language. This parameter is only applied when creating a new database. It is ignored otherwise.

    Supported values:

    • 1029 - Czech
    • 1051 - Slovak
    • 1033 - English
    • 1031 - German
    • 1045 - Polish
  • /collation <collation name> - Collation of the new database. For list of values, view Microsoft SQL - Collation and Unicode support. If not specified, the database server's default collation is used (SQL_Latin1_General_CP1_CI_AS for Azure SQL Database).

    The catalog collation of an Azure SQL Database is automatically set to DATABASE_DEFAULT, ensuring it matches the database collation.

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

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 as the executable file.

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

2. 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"

3. Upgrade all databases in a multitenant environment:

DatabaseDeploy.exe /conn "Data Source=.\sqlexpress;Initial Catalog=AlvaoTenants;Integrated Security=True;TrustServerCertificate=True" /multitenant