Exporting Data to SQL Server
The Open Data Export Centre allows data to be exported from InfoAsset Manager to a variety of formats including SQL Server database.
The Microsoft OLE DB Provider for SQL Server must be installed in order to export to SQL Server databases.
In addition to exporting data to a new Feature Class, the Open Data Export Centre can be used to update an existing Feature Class.
Exporting to a New Feature Class
The Open Data Export Centre can be used to export InfoAsset Manager tables to a new Feature Class in a SQL Server database. Further details of export options are listed in the Open Data Export Centre topic.
To export to a new Feature Class:
- In the Open Data Export Centre dialog select the InfoAsset Manager table to be exported from the Table To Export Data From dropdown.
- Select the SQL Server option from the Export Type dropdown in the Export Data To section.
- Use the File browse button to connect to an existing database. The Select SQL Server Data dialog will be displayed.
- In the Select SQL Server Data dialog, enter database connection details and click OK.
- In the Open Data Export Centre dialog, type in the name of a new Feature Class to which the data is to be exported.
- Map InfoAsset Manager internal fields to Feature Class export fields by loading a configuration file or by manually mapping the fields in the Field Mapping Grid.
- Click the Export button.
The specified Feature Class will be created and InfoAsset Manager data will be exported to it.
Updating an Existing Feature Class
In addition to exporting data to a new Feature Class, the Open Data Export Centre can be used to update an existing Feature Class.
To update an existing Feature Class:
- In the Open Data Export Centre Dialog, use the File browse button to connect to an existing database. The Select SQL Server Data dialog will be displayed.
- In the Select SQL Server Data dialog, enter database connection details and click OK.
- In the Open Data Export Centre dialog, select an existing SQL Server Database Feature Class from the Feature Class dropdown list. The Updating and Delete Options section will become enabled.
- Map InfoAsset Manager internal fields to Feature Class export fields by loading a configuration file or by manually mapping the fields in the Field Mapping Grid. In the Field Mapping Grid:
- Red indicates items in the Export Field Name column and Internal Field column that are mapped as update keys
- Italic font in the Export Field Name column indicates fields that do not exist in the selected Feature Class.
- The Export Field Name column contains a drop list of only the field names from the selected Feature Class. Entering a non-existent name specifies a new field name.
- Map update keys - select the fields to be used to locate items for update in the specified Feature Class. The Update Based On dropdown list contains all update mapping options applicable to the current Table to be Exported:
- Asset ID - the Asset ID field is used to locate row objects in the specified Feature Class.
- InfoAsset Manager Primary Key Fields e.g. ID for node objects and Distribution System link objects, US Node ID, DS Node ID, Link Suffix for Collection System link objects and ID for all objects types in Asset Systems. The Primary Key Fields are used to locate row objects in the specified Feature Class.
- Set Only Update Existing Objects option:
- Check the Only Update Existing Objects box to restrict update to objects that already exist in the specified Feature Class. If this option is unchecked, any objects in the InfoAsset Manager table to be exported that do not match objects in the Feature Class will be added to the Feature Class.
- Set Delete Missing Objects option:
- Check the Delete Missing Objects box to search for missing objects and delete them from the target database at the end of the export process. (A missing object is an object that is in the external Data source table, but is NOT in the InfoAsset ManagerTable to Export Data From.)
- The update key selected in the Update Based On dropdown will be used to search for missing objects.
- All missing objects found will be listed and a prompt for confirmation of deletion will be displayed before any objects are deleted.
-
Set Update using changes from a previous version of the network option:
-
Check the Update using changes from a previous version of the network box to compare the current version of the network with a selected previous version of the network. Differences in objects, identified by the comparison, will be applied to the external data table.
-
- Click the Export button to export data from InfoAsset Manager to the specified Feature Class. All fields, except mapped update keys will be updated in the Feature Class.
Notes
Errors and warnings may be displayed after export listing details of row objects that have not been updated. Examples of reasons for update failures are listed below.
- There are multiple matching rows in the target database. For example, when updating based on Asset ID, if more than one object has the same Asset ID.
- The data type is invalid. For example, if trying to use character data to update a field in the Feature Class with a data type of double.
- A row has a null update key.For example, when updating based on Asset ID, if the InfoAsset Manager Asset ID field is null.
After carrying out a deletion, a summary of the export process is displayed including a count of items deleted from the target database.
The summary provides information on the following:
- Row Objects Read: the number of InfoAsset Manager objects read for the purpose of adding or updating, but not deleting
- Row Objects Added: the number of new objects created in the target database
- Row Objects Deleted: the number of existing objects deleted from the target database
- Row Objects Updated: the number of existing objects updated in the target database
- Total Fields Updated: the number of fields updated. The count includes fields that were updated with the existing value.