5.11 Exporting and Importing SQL Scripts

You can transfer scripts from your current Script Repository to a Script Repository in a different workspace by using the Export and Import tasks.

Exported scripts are encoded in a single file on your local file system. Once exported, you then log in to another workspace and import the file. During import, the file is run to re-create the scripts in the current Script Repository.

By default, the Export SQL Scripts page lists all scripts in the Script Repository created by the current user. There are two panes on the Export SQL Scripts page, the Scripts pane and the Scripts to Export pane. You use the Scripts pane to select scripts to export. Then, you use the Scripts to Export pane to finalize the scripts to export, to choose a name for the export script, and to save the selected scripts in the export script on your local file system. You use the Import Scripts pane to select the export script containing the scripts to import.

5.11.1 Copying Scripts to an Export Script

Learn how to copy scripts to an export script.

To copy scripts to an export script:

  1. On the Workspace home page, click SQL Workshop and then SQL Scripts.

    The SQL Scripts page appears.

  2. On the Tasks list, click Export.

    The Export SQL Scripts page appears.

  3. Select the scripts you want to export. To select all displayed scripts, click the column head check box.
  4. Click Add to Export.

    The selected scripts are added to the list of scripts in the Scripts to Export pane.

  5. Enter a name for the export script in the File Name field.

    The default script name is workspace_name_script.sql.

  6. Click Export All to export the scripts to the export script.

    You are prompted to enter the directory where you want to save the export script.

5.11.2 Importing Scripts

Learn how to import the listed scripts into the current Script Repository.

To import scripts:

  1. On the Workspace home page, click SQL Workshop and then SQL Scripts.

    The SQL Scripts page appears.

  2. On the Tasks list, click Import.

    The Import Scripts pane appears.

  3. Browse to export script you want to import to the Script Repository.
  4. Click Next to list the scripts in the export script.

    The Import Scripts page appears. The Action column indicates whether the imported script is new, or whether it replaces an existing script of the same name.

  5. Click Import Script(s) to import the listed scripts into the current Script Repository.

    The SQL Scripts page appears listing the imported scripts.