Combine supportBack to main support page
Dynamic Container Wizard
Make sure that the Static Container that holds the Reference database is
created prior to starting the Dynamic Container Wizard. For more information
regarding the Reference database and Dynamic Containers please refer to the
section titled Static vs.
The Dynamic Container Wizard will walk you through the steps required to create a Dynamic Container. In the wizard you will be asked to choose the Reference Static Container, and a query that returns the database and server names from the Reference Static Container. When the wizard is started you will first receive a welcome page. You can choose to not display this welcome page in the future by checking the "Do not show welcome page next time" checkbox. Press Next to move on to the next window.
The welcome window of the Dynamic Container Wizard.
The next window in the wizard will ask you for the name, description, and authentication type. The name will be used to identify the Container. The description field is optional and lets you associate comments with the Container. The authentication type can be set to one of SQL Authentication, Windows Authentication, Prompt, or Use Parent Settings which is also the default. The authentication type is used to connect and deploy code against all databases defined in the Container.
Also you can use check box Use Encryption to turn on SSL encryption for a connection to DB server.
Entering the name, description, and authentication type for the
To demonstrate the creation of Dynamic Containers, consider the example of the Production environment in the following diagram. Using the wizard, the Dynamic Container named DBA Databases will be created below.
43: Containers and target databases in the Production SQL server
Assume that the Static Container named DBServerMap is already available in the Container Manager under the Production Environment as illustrated in the image below.
44: The DBServerMap Static Container that holds the Reference
Furthermore, assume that the Reference database ServerRepository contains a table called DBServers with the entries listed in the figure below.
The content of DBServers table in the Reference database
In order to create the Dynamic Container you will need to write a query that returns a single result set where each row entry corresponds to a single target database. The following fields should be returned by the query:
- ServerName (string, possibly Unicode): The name or IP address of the SQL server that holds the target database. If you are running multiple instances of SQL server on the same physical machine and wish to include a target database on one of the instances, the ServerName returned from the query should be of the format MachineName\InstanceName. For example, ProdSvr21\Instance1.
- DatabaseName (string, possibly Unicode): The name of the target database.
- ServerPort (integer, optional, should only be used if server port is not 1433): The ServerPort holds the communication port for the SQL server. This option should only be used by advanced users who are running multiple instances of SQL server on the same machine, or in any other cases whereby the SQL server port is other than 1433 (which is default SQL server port). If the ServerPort column is not returned by the query then Combine will use port 1433 to establish a connection to all target databases.
1. Keep in mind that Combine thoroughly examines the values returned by the query and will validate that all settings were entered correctly. If any values are invalid or if Combine cannot successfully establish a connection to all target databases before running the script or any portion of a code package, then code will not be deployed on any target database and the user will be prompted with the list of issues found.
2. If the query returns the same ServerName and DatabaseName twice (regardless of the value for all other fields) only the first entry that has the duplicate ServerName and DatabaseName pair value will be considered. All other entries with the same ServerName and DatabaseName will be ignored.
3. If the query returns more than a single result set then only the first result set will be considered and processed. All other result sets will be ignored.
Returning to the example of the Production Environment above, the query that returns the database and server names for all Container databases is:
SELECT NameOfServer AS ServerName,
NameOfDatabase AS DatabaseName
WHERE IsDBA = 1
Going back to the wizard, you will now be asked to select the Static Container for the Reference database.
Selecting the Static Container that contains the Reference
After pressing the Next button, you will be prompted to enter the query for the Dynamic Container. You can also press the Test button to check whether the query results are correctly interpreted by Combine. Press the Next button when you are done. In the last wizard page click Finish to complete the Dynamic Container creation.
Selecting the Static Container that contains the Reference
After the DBA Databases Dynamic Container has been created, the Container Manager displays this Container as in the image below. The Reference denotes the Static Container of the Reference database and can be changed through the properties window, or by invoking the Dynamic Container Wizard from the right-click menu of the Dynamic Container.
The Container Manager interface for the DBA Databases Dynamic
You can also edit the query by right-clicking the query icon and pressing Open. If for some reason the Static Container used to store the Reference database is dropped, the icon of the Reference databases will be changed to alert you of that fact. The new icon is presented in the figure below. In addition, you can search for the Static Container of the Reference database by right-clicking the Dynamic Container Reference icon and pressing the Locate menu option.