Aqua Data Studio’s Server Script Generator generates SQL Scripts for Server Objects in a database by producing a single script file of all contained server objects or individual server script files per object. Server Scripts are used for database management of backups, alerts, logins, users, roles, profiles, tablespaces and other server-based objects. The server objects available for scripting vary depending on database vendor and version.

The Server Script Generator differs from the Schema Script Generator in that Server Scripts are for database management, while Schema Scripts are for schema objects such as tables and procedures.

The Server Script Generator can generate syntax highlighted scripts in a preview window for copy and paste. The steps to Generate Server Scripts are described below.

1. Launch the Server Script Generator dialog by Selecting Tools->Server Script Generator from the Menu Bar, or selecting Tools->Script Generator from the right-click pop-up menu on a database in the Schema Browser.

2. In the General Tab, select a Database and pick its Server Objects. In the left panel, select one or more types of objects to be scripted. Click the green check button to select all, the red X button to de-select all, or the red/green button to revert the current selection. All objects matching the selected types will appear in the right panel. Select one or more objects to be scripted. The quickfilter can be used to select objects via wildcards. Click the green check button to select all, the red X button to de-select all, or the red/green button to revert the current selection. Click Next.

3. In the Options Tab specify where to save the generated script or scripts. Save as One File so that all SQL Statements will be output to a single file. Save as One File Per Object so that SQL statements will be output to one file per object, or Preview the SQL so that all the SQL statements will be output to the Preview tab for copy and paste. The directory and file name, encoding and platform of the file can be set. Select any appropriate options for:

  • Statement Separator - GO, /, ; or enter your own separator. For reuse within Aqua Data Studio, GO is the preferred separator.
  • Object Quoted Identifier - none, [ ], "" or ’’
  • Generate the CREATE - generate CREATE statements for the selected objects.
  • Generate the DROP - generate DROP statements for the selected objects.
  • Include Descriptive Header - include a header at the top of the file indicating the date, time, database, schema and names of objects contained in the file.
  • Use Conditional DROP - DROP a table with conditions.
  • Include blank line between statements - Include blank lines to improve format of output.
  • Overwrite Existing Script(s) - When scripting one object per file, allows to overwrite current scripts instead of generating enumerated script names

4. Click Next to generate the scripts for the selected objects. The Status Tab displays the progress of the Server Script generation, with Elapsed Time, Remaining Time, Average Item Time and Number of Items per Second. The output process can be halted at any point by clicking Cancel. Error and Warning messages apear in the "Important Messages" pane at the bottom of the Status Tab.

5. If Preview was selected as the destination of the export, the Preview Tab displays the export with syntax highlighting for copy and paste use.

Click Close to close the dialog or click Previous to change selections and regenerate the script(s).

  • No labels