Generating for Replication Server

You can generate Replication Server scripts (*.sql) for the replication process, and/or for the primary and remote databases.

One SQL file is generated per server and contains all the orders for the server. The SQL file cannot be executed using an live database connection. You need to use the isql command to execute this SQL file. You can preview the script that will be generated for each object on the Preview tab of its property sheet.
Note: In order for you to connect properly to the replication process you must verify that:
  • The code of the replication process object corresponds to the instance name of the Replication Server

  • The User name and Password extended attributes correspond to the Replication Server login user name and password

  • Each database has been generated using one of the Generate commands from its contextual menu

isql.exe -e -U USRNAME -P PWD -S SVR_TEST -i SVR_TEST.sql
  1. Select Tools > Replication Server version > Generate Scripts to open the Generate dialog.

    You can, alternately, right-click any database or replication process in the replication environment and select Generate Scripts to open the Generate dialog and generate a script for that element only.

  2. Specify a directory in which to generate the scripts.
  3. [optional] Select the Check Model option to verify the validity of your model before generation.
  4. On the Targets tab, select the replication engine(s) that you want to generate for. This tab may not appear if you are generating for only a single replication process.
  5. On the Selection tab, select the objects that you want to include in the generation. Use the sub-tabs to navigate between separate lists of object types. The selections you make here will affect the files that are available to select on the Generated Files tab.
  6. On the Options tab, set generation options as appropriate. The following options are available:

    Option

    Description

    Create replication object

    Specifies to include create statements for this type of replication object in the generated script.

    Drop replication object before creation if it already exists

    Specifies to include drop statements for this type of replication object in the generated script before inserting the appropriate create statement.

    Materialize subscriptions

    Specifies how the data associated with subscriptions is to be materialized.

  7. On the Tasks tab, select generation tasks as appropriate. The following tasks are available:

    Task

    Description

    Execute generated scripts in Replication Server

    Allows you to directly execute the generated scripts in Replication Server.

    Execute generated scripts in RepAgent

    Allows you to directly execute the generated scripts in RepAgent.

    Note: To execute these tasks, you must have OpenClient isql installed on your machine. For information on how to install OpenClient isql for Replication Server, see the Replication Server documentation
  8. Click OK to generate the scripts in the specified directory.

    When the generation is complete, the Generated Files dialog opens listing the scripts, each of which you can open and review by selecting it and clicking Edit.

    The Replication Server file is generated in the destination directory.