Importing and Exporting Source Objects and Column Definitions

When you are adding a subscription you can use SHIFT-click or CTRL-click selection techniques to refine the list of source objects that you want to replicate. The Add Subscription Wizard also provides an alternate method for manipulating the source object list with the Export and Import buttons on the Select the Source pane. You can import the contents of a tab or semicolon-separated text file (with a .txt extension) to populate the Source Objects list of the source selection pane. Review the topic Creating Multiple Subscriptions for Same Source to understand the implications of creating multiple subscriptions at once.

When you export source object names, they are saved in a tab-delimited text file that contains the following values for each source object:

<schema> <table_name> <object_type>

After you export the source object names you can use a text editor such as Notepad, or spreadsheet application such as Excel, to manipulate the list of source objects that you want to subscribe to. For example, if a database has a very large number of tables and you want to replicate sixty percent of them, you could export the entire list of tables, use search and selection techniques within the text or spreadsheet application to remove the names of the objects you do not want to replicate, and then import the list of source objects that you do want to replicate. This procedure can provide a more efficient method of selecting objects than using the SHIFT-click or CTRL-click method of selecting which objects to replicate.

You can also specify a different name for the destination table; this feature is only applicable if you are creating multiple subscriptions:

<schema> <src_table_name> <object_type> <dest_table_name>

Another modification you can make is to add lines using the following format (where object_type is COLUMN or MAP), which allows the same text file to be used for defining derived columns and custom column mappings as well as importing table names. You can also use the JSON format.  See Importing Mapping Scripts.

<schema> <table_name> <object_type> <expression> <destColName> <destColType> <type> <precision> <scale nullable>

When specifying column definitions, you can use the wildcard character (%) for schema and table names. For example:

% % DROP COL1
% % MAP        DESCRIP varchar 1024 0 TRUE

Note that even though the same import file can be used for both purposes (importing a list of tables and importing column definitions), each line in the file is used for only one purpose.

Begin a line with the hyphen character to designate a comment.

Follow the steps below to export the names of selected source objects from the Source Objects list to a tab-delimited text file, modify the file, and import the contents of the modified file into the Source Objects list of the Subscription Wizard.

  1. Start the Add Subscription Wizard if it is not already active.

  2. In the Select the Source pane specify the Source Filter parameters and click the Refresh button to list the objects of that source.

  3. If you want to export all of the source object names, click the Export button with no objects selected. To export a subset of the objects use the SHIFT-click or CTRL-click techniques to select which objects and click Export.

  4. In the Save As dialog select the directory in which you want to save the file, enter a filename, and select the file type. Save the file in ASCII text (.txt). Click Save.

  5. If the filename already exists you are asked whether you want to overwrite it, and a dialog appears to confirm how many source object names were exported. Click OK to proceed.

  6. Modify the list of source objects as desired using a text editor or spreadsheet application and save the file with a new filename.

  7. From the Subscription Wizard - Select the Source pane, click the Import button.

  8. In the Open dialog locate the .txt file that you edited and click Open.

  9. Click OK to acknowledge the dialog that confirms how many names were imported. Note that an entry may be greyed-out if it would result in a duplicate subscription or if the table does not exist on the source or the user does not have authority to know of its existence.

  10. Click Next to continue defining the new subscriptions for the imported source objects.

After you create the subscriptions, modify the properties of individual subscriptions as appropriate for the particular data each will replicate, such as to add SQL processing statements.