Online Documentation for SQL Manager for SQL server

DDL to Files


The DDL to Files section of the Database Registration Info dialog allows you to set options for saving database objects definitions to files.

Saving objects definitions to files allows using external tools for processing database scripts or using version control systems for their storage.

 

To launch the Database Registration Info dialog with DDL to Files tab opened use the Tools | DDL to Files | btnDBRegistrationInfo Options main menu item, or right-click the database alias in the DB Explorer tree and select the Tasks | DDL to Files | btnDBRegistrationInfo Options item of the context menu.

 

Database Registration Info - DDL to Files

 

 

CheckBox Write object definition to a file after compilation

Check this option if you want to save objects DDL after changing their definition and subsequent compilation.

 

Root folder for storing object definitions

Use the btnSelectDirectory button to select the directory for storing files with objects DDL. In order to make this data be under version control this directory must be a working copy.

 

File to store common options (relative path)

Enter the name of *.xml file that will contain the list of types of objects which definitions should be stored in files. This file contains templates of object file names as well.

Note: If you do not provide the full path to the file it is stored in the directory defined in the Root folder for storing object definitions field. To select another location use the btnSelectDirectory button.

Click the Edit File button to select object types and set templates for file names in the Options for Storing Object Definitions dialog.

 

File to store object file names (relative path)

Enter the name of *.txt file that will contain object names and file names respective to those objects.

Note: If you do not provide the full path to the file it is stored in the directory defined in the Root folder for storing object definitions field. To select another location use the btnSelectDirectory button.

Click the Edit File button to set file names in the Object File Names dialog.

 

CheckBox Confirm file name for new object

If this option is checked then you will be asked to set a file name for a newly created object in the Confirm Object File Names dialog. The file name for a new object is generated automatically based on defined templates but you can change it if needed.

 

Database Registration Info - DDL to Files - Confirm object file name

 

 

The following fields can be used for working with version control systems.

 

OS command after creating a file

Enter any command that will be executed after a file with object definition is created.

If you are using version control system then, for example, the following command can be entered: svn add {file_name} (for Subversion revision control system) where {file_name} stands for the respective newly created name of a file with object definition.

 

OS command before updating a file

Enter any command that will be executed before a file with object definition is updated.

If you are using version control system then, for example, the following command can be entered: ss checkout {file_name} -C- (for Visual Source Safe revision control system) where {file_name} stands for the respective name of a file with object definition being updated.

 

OS command after deleting a file

Enter any command that will be executed after a file with object definition is deleted.

If you are using version control system then, for example, the following command can be entered: svn del {file_name} (for Subversion revision control system) where {file_name} stands for the respective name of a file with object definition being deleted.

 

Click the Write All Objects Now button to save immediately all selected objects definitions to respective files set in the Object file names dialog. The content of already existing files will be updated.

 

Click the Generate Script... button to create an *.sql file containing definitions of all objects. The order of objects definitions is the same as in the Object file names dialog.