About Working with Queries

Using the Historian Interactive SQL application (ihSQL.exe), you can run an SQL query and display the results of the query in the same window. It is useful if you want to test a query using the OLE DB provider.

It can open and save SQL queries and can show multiple windows, each containing a query request to the same server or different servers. For instance, you might want to open more than one window to compare two different time periods on the same server, or the same time period on different servers.

The Historian Interactive SQL application allows you to access data quickly and efficiently. Using this application, you can:
  • Test SQL syntax before using it in an application.
  • Troubleshoot OLE DB connections or Historian errors.
  • Perform more complex searching or filtering of data than you can in the Historian SDK and administration applications.
  • Retrieve data from any available Historian server.
  • Save and access queries.
  • Export query results to Microsoft Excel.
The Historian Interactive SQL application toolbar provides quick access to common functions such as:
  • Executing queries
  • Switching to a new Historian server
  • Exporting query results to Microsoft Excel
  • Saving a query
  • Printing query results
The following figure shows the toolbar for the Historian Interactive SQL application, outlining what each button does.