SQL Mail Merge

The primary function of SQL Mail merge is to create a file of exported data on the basis of an SQL Select query, typically for use in a mail merge Word document. The data may also be used for analysis in Excel, for example.

Only SQL statements that begin with the word Select are allowed. All other commands such as Update, Insert or Delete are prohibited and will fail validation.

Once the file is created you can export the data to a nominated file folder on the system’s network or to a local machine.

Before creating SQL Mail Merge, users and user groups must be set up via v4 Client | Tools | Administration | User Management | User Accounts/User Groups.

The SQL Mail Merge query is set up by the system administrator in v4 Online. The system administrator nominates which users and user groups may initiate the query.

  • Create SQL Mail MergeCreate SQL Mail Merge

    To create a new SQL Mail Merge:

    1. In One v4 Online, select Administration | System Admin | SQL Mail Merge to display the SQL Mail Merge Query page.
    2. Click the Add New Query button to display the Query Name dialog.
    3. Enter details as required.
    4. Click the Save button to display the SQL Statement field.
      Information is given in the Parameters panel displaying parameters that are available to use within the clause of the SQL statement.
    5. Enter the SQL Statement text. Only SQL statements that begin with the word Select are allowed.
    6. Click the Save button to display the SQL statement.
    7. Choose from the following options:
      • Click the Preview button on the Parameters panel to display the SQL Mail Merge dialog.
        This displays the results of the SQL query.
      • Click the Export button on the Parameters panel to display the Save Output As dialog.
        This enables you to save the files and export the queries.
  • Add Users to SQL Mail MergeAdd Users to SQL Mail Merge

    To add users to the SQL Mail Merge:

    1. Click the Users tab to display the Users page.
    2. Click the Edit button to display the Users Filter dialog.
    3. Search for and select users as required.
  • Add Groups to SQL Mail MergeAdd Groups to SQL Mail Merge

    To add user groups to the SQL Mail Merge:

    1. Click the User Groups tab to display the User Groups page.
    2. Click the Edit button to display the Groups Filter dialog.

      Clicking the plus sign next to a group displays the list of users in that group.
    3. Search for and select groups as required.

Use the SQL Mail Merge Button

The SQL Mail Merge button displays in many areas of v4 Online. Clicking the SQL Mail Merge buttonbutton only allows you to preview and export existing queries.

A&T Back Office, Applications, Bases, Music Tuition or Training Manager

CSS & Governors

Transport Back Office

To preview and export an existing query:

  1. In v4 Online, select an entity for which an SQL mail merge has been created.
  2. Click the SQL Mail Merge button to display the SQL Mail Merge Search Filters dialog.
    The Context is populated according to the entity where the SQL Mail Merge button was selected.
  3. If required, enter the SQL Query Name in the Looking For field to search for the SQL mail merge.
  4. Select the required SQL Query Name and choose from the following options:
    • click the Preview button to display the SQL Mail Merge Preview dialog.
      You may need to use the scroll bar to view all of the results.
    • Click the Export button to display the Save As dialog.
      Save the file to the desired location.