Solved

Is it possible to generate a 'DB' script with a different database name than used before?

  • 21 February 2019
  • 3 replies
  • 109 views

Userlevel 7
Badge +23
In a project I work on, we would like to generate scripts for them and create a database named differently than we have.
For example: our application/database is called 'Original', now I would like to generate all scripts but change the to-be-created database name to 'Customer' without having to edit the scripts or open them in the SQL Server Management Studio and run them myself. (One-click deployment)

Connecting to the database 'Customer', which does not exists yet, will ensure the checkboxes (in the 'Execute source code' step) are checked accordingly. The 'DB' and the 'Create' scripts are checked and the generated script will run on the given database. But sadly the first script does not contain the 'Customer' database name, but the 'Original' name. So an error will occur since it tries to create a database that already exists, or even worse, make a database which will not be used.

Where can I change this?

I noticed that the Runtime configuration does affect the generation of the 'DB' script but is this the only way?
icon

Best answer by Anne Buit 21 February 2019, 13:15

View original

3 replies

There is a field called "Database name", in the projectversion of a project. This is where you can set the name of the database, which is used when the DB-scripts are generated.


This implies that you can set a different database for each project version or branch. It is not common to change the database name for a projectversion of a project, since it's not likely to change in time.

It's more common that you change the name of the database of a branch version, because you have to use different database names for development or test purposes. But the trunk version will allways have the same, unchanged databasename.
Userlevel 7
Badge +23
There is a field called "Database name", in the projectversion of a project. This is where you can set the name of the database, which is used when the DB-scripts are generated.


This implies that you can set a different database for each project version or branch. It is not common to change the database name for a projectversion of a project, since it's not likely to change in time.

It's more common that you change the name of the database of a branch version, because you have to use different database names for development or test purposes. But the trunk version will allways have the same, unchanged databasename.


Thank you for your answer Dave. I'm sad to see that I don't have this option. Are you using the 2018.3 version of the Software Factory? I did notice in the Configuration under Settings that I can name a database name, maybe it does the same thing as you described. But I'm worried that will not be version based.

Userlevel 7
Badge +5
Hi Mark,

You are correct, in 2018.3 the fields Dave was writing about have been moved. These settings can now be found in the menu, under Deployment - Runtime configurations.

The database name used in the default runtime configuration will be used in database creation scripts.

Reply