<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel xmlns:blog="http://www.dotnetnuke.com/blog/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <title>Drew Salem</title>
    <description>Honeywell API development and System Integration for the resource industry.</description>
    <link>http://www.sqlservermonitor.com/About/Blog/tabid/220/BlogId/1/Default.aspx</link>
    <language>en-US</language>
    <webMaster />
    <pubDate>Sun, 20 May 2012 09:33:12 GMT</pubDate>
    <lastBuildDate>Sun, 20 May 2012 09:33:12 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 4.0.0.0</generator>
    <item>
      <title>Extracting Uniformance PHD data within SQL Server using the PHDOLEDB provider</title>
      <link>http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/6/Extracting-Uniformance-PHD-data-within-SQL-Server-using-the-PHDOLEDB-provider.aspx</link>
      <description>&lt;p&gt;It's possible to access PHD data via a simple SQL query within SQL Server (I say simple as at the time of writing, joins cannot be done, &lt;a href="http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/5/PHDOLEDB-OLEDB-provider-for-Honeywells-PHD-anomalies.aspx"&gt;discussed here&lt;/a&gt;). In essence if you are retrieving live well data, say every 5 seconds, then you can query that live data using SQL either from within SQL Server or from an application using a stored procedure or inline code etc.&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;To do this you need to install the Honeywell Uniformance PHD software client tools/desktop components (which comes on the same disk as the server software). Once you have done this, a new data provider will be listed when extracting data from capable applications. It should read like "Uniformace PHD OLE/DB Provider".&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Create a new SQL Server Linked Server (more info here), and with the Other data source radio button selected, select "Uniformace PHD OLE/DB Provider" as the provider. The Product name being PHDOLEDB and the Data source being the name of the PHD Server. You can call the linked server anything you want.&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;On the Security page, select "Be made using the login's current security context". This means it will run the query using the account of the user executing the query.&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;On the Server Options page change the RPC (remote procedure call) to Out.&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Click OK, and a new node will appear in SSMS under Linked Servers.&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Normally that would be that and you'd be able to view data from this linked server by expanding catalogs within this new node and querying against that catalog, however this isn't the case here. By default, all provider executions are run through a process seperate from SQL Server's. This doesn't work for the PHDOLEDB provider though. For this to work, the query must be called within the SQL Server process executing the query. SQL Server allows us to change this. To do this expand the Providers' node (sitting under the Linked Servers node). View the properties of the PHDOleDB provider and enable the "Allow inprocess" checkbox.&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Now when you expand the linked server's catalogs, you will see PHD RemoteAPI and StandardAPI catalogs, with tables listed under the StandardAPI catalog. You can now query against these tables.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Keep in mind, that these are not real tables. By default, PHD does not store data in a relational database but as flat binary files. What this provider does is mimic standard database tables so that you can run SQL queries against it.&lt;/p&gt;
&lt;p style="text-align: left"&gt;You can test this by running a query against the table phd_tag, such as:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0000ff"&gt;&lt;span style="font-family: Courier New"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Courier New"&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;span style="color: #0000ff"&gt;&lt;font size="2"&gt;FROM&lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;span style="color: #000000"&gt;&lt;font size="2"&gt;YOUR_LINKEDSERVER_NAME&lt;font size="2"&gt;.&lt;/font&gt;StandardAPI&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;phd&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;phd_tag&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Note that the table name must be fully qualified with the server, catalog and schema name.&lt;/p&gt;
&lt;p&gt;Don't get frustrated if you find your query returns errors (I've done that for you). With it not looking at real tables, the provider has tedious limitations discussed in &lt;a href="http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/5/PHDOLEDB-OLEDB-provider-for-Honeywells-PHD-anomalies.aspx"&gt;detail here&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href=http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/6/Extracting-Uniformance-PHD-data-within-SQL-Server-using-the-PHDOLEDB-provider.aspx&gt;More ...&lt;/a&gt;&lt;div class="tags"&gt;Tags: linked server,phd data&lt;/div&gt;&lt;div class="category"&gt;Category: &lt;a href=/About/Blog/tabid/220/CatID/2/Default.aspx&gt;1. Honeywell SCADA&lt;/a&gt;&lt;/div&gt;</description>
      <author />
      <category domain="/About/Blog/tabid/220/CatID/2/Default.aspx">1. Honeywell SCADA</category>
      <comments>http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/6/Extracting-Uniformance-PHD-data-within-SQL-Server-using-the-PHDOLEDB-provider.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/6/Extracting-Uniformance-PHD-data-within-SQL-Server-using-the-PHDOLEDB-provider.aspx</guid>
      <pubDate>Mon, 03 Jan 2011 13:00:00 GMT</pubDate>
      <trackback:ping>http://www.sqlservermonitor.comDesktopModules/BlogTrackback.aspx?id=6</trackback:ping>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/10/Default.aspx">linked server</blog:tag>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/11/Default.aspx">phd data</blog:tag>
    </item>
    <item>
      <title>PHDOLEDB (OLEDB provider for Honeywells PHD) anomalies</title>
      <link>http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/5/PHDOLEDB-OLEDB-provider-for-Honeywells-PHD-anomalies.aspx</link>
      <description>&lt;p&gt;There are a few show-stopping limitations and/or bugs to the PHD OLEDB provider (at the time of writing). The tables provided by the provider are:&lt;/p&gt;
&lt;p&gt;PHD_DATA&lt;br /&gt;
PHD_LINK_LIST&lt;br /&gt;
PHD_PARENT_TAG&lt;br /&gt;
PHD_RDI_LIST&lt;br /&gt;
PHD_REDUCTIONS&lt;br /&gt;
PHD_TAG&lt;br /&gt;
PHD_TAG_BROWSE&lt;br /&gt;
PHD_WRITE_DATA&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline"&gt;Anomaly One: Standard SQL cannot be used on all tables consistently&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some tables such as PHD_TAG can be queried successfully using a standard SELECT query against a linked server such as:&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;standardapi&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd_tag&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;This will return all your tags with relevant attributes such as their interpolation method, whether they have been manually inputted and their description.&lt;/p&gt;
&lt;p&gt;However if you run a similar query against PHD_DATA (which holds the tag data such as the value, confidence, timestamps etc):&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;standardapi&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd_data&lt;/font&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;You get nothing.&lt;/p&gt;
&lt;p&gt;If you specify a tag number and timestamp:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(0,0,205)"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;font color="#000000"&gt;   &lt;/font&gt;&lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;standardapi&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd_data&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;font color="#000000"&gt;  &lt;/font&gt;&lt;font color="#800000"&gt;tagname&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;'301GXXXXI004.PV'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;AND&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;start_timestamp&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;'Now-30'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;AND&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;end_timestamp&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;'Now'&lt;/font&gt;&lt;font color="#000000"&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You still get no results.&lt;/p&gt;
&lt;p&gt;If you run a query in the following format (which is normally valid):&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(0,0,205)"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#ff0000"&gt;'SELECT * FROM   phd_data'&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;AT&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#000000"&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;No results. But if you use the previous format with a tag number and timestamp, you DO get results back:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(0,0,205)"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#ff0000"&gt;'SELECT * FROM phd_data WHERE  tagname = "301XXXXX2I004.PV" &lt;br /&gt;
AND start_timestamp = "Now-30" AND raw_data = 0 AND end_timestamp = "Now" &lt;br /&gt;
AND sample_interval = 3600000'&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;AT&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That last query returns all columns for tag 301G00342I004.PV for the past 30 days with an hourly value. Use double quotes in your query to specify strings, otherwise you get an error.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline"&gt;Anomaly Two: Simple SQL Joins cannot be made on all tables&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A basic requirement would be to combine data from two tables to return overall information on a tag. For example, the value of the tag is stored in phd_data. The tag's description is stored in phd_tag.&lt;/p&gt;
&lt;p&gt;Running the following returns an error message:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;SELECT&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;tagname&lt;/font&gt;&lt;font color="#c0c0c0"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;tagno&lt;/font&gt;&lt;font color="#c0c0c0"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;font color="#800000"&gt;tg&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;description&lt;br /&gt;
       &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;timestamp&lt;/font&gt;&lt;font color="#c0c0c0"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;sample_interval&lt;/font&gt;&lt;font color="#c0c0c0"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;confidence&lt;/font&gt;&lt;font color="#c0c0c0"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#0000ff"&gt;VALUE&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;font color="#000000"&gt;   &lt;/font&gt;&lt;font color="#800000"&gt;phd_data&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;INNER&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;JOIN&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;phd_tag&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;tg&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
         &lt;/font&gt;&lt;font color="#0000ff"&gt;ON&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;tg&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;tagno&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;tagno&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;font color="#000000"&gt;  &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;tagname&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;'301XXXXI004.PV'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;AND&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;start_timestamp&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;'Now-30'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;AND&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;raw_data&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; 0 &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;AND&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;end_timestamp&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;'Now'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt; &lt;br /&gt;
       &lt;/font&gt;&lt;font color="#0000ff"&gt;AND&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;dt&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;sample_interval&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#c0c0c0"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt; 3600000  &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left"&gt;&lt;span style="font-size: larger"&gt;&lt;strong&gt;&lt;span style="color: rgb(255,0,0)"&gt;Msg 208, Level 16, State 1, Line 1&lt;br /&gt;
Invalid object name 'PHD_DATA'. &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I reluctantly tried this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0,0,255)"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;EXEC&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#ff0000"&gt;'SELECT dt.tagname, dt.tagno, dt.timestamp, dt.sample_interval, dt.confidence, &lt;br /&gt;
dt.VALUE FROM phd_data dt INNER JOIN phd_tag tg ON tg.tagno = dt.tagno &lt;br /&gt;
WHERE  dt.tagname = "301GM003FI004.PV" AND dt.start_timestamp = "Now-30" AND dt.raw_data = 0 &lt;br /&gt;
AND dt.end_timestamp = "Now" AND dt.sample_interval = 3600000'&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;AT&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#ff0000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;However, this returns:&lt;/p&gt;
&lt;p style="text-align: left"&gt;&lt;strong&gt;"PHDOleDB" for linked server "myphdlink" returned message "Execute Failed".&lt;br /&gt;
OLE DB provider "PHDOleDB" for linked server "myphdlink" returned message "PHD Server Initialisation Failed".&lt;br /&gt;
OLE DB provider "PHDOleDB" for linked server "myphdlink" returned message "ParseSQLString Failed".&lt;br /&gt;
OLE DB provider "PHDOleDB" for linked server "myphdlink" returned message "Bad Column Ordinal".&lt;br /&gt;
&lt;span style="color: rgb(255,0,0)"&gt;Msg 7215, Level 17, State 1, Line 1&lt;br /&gt;
Could not execute statement on remote server 'your_linked_server'&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;So what's the solution? I've no idea. If you find one, let me know. In the meantime, I have put a call in and am awaiting a response from Honeywell.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline"&gt;&lt;br /&gt;
Anomaly Three: Query results cannot be stored in temporary or memory tables.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I figured if results are being returned to a screen, then they can be stored in temp tables. If the data is in temp tables, then they can be joined.&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;SELECT &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;INTO&lt;/font&gt;   &lt;font color="#800000"&gt;#temp_tag&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;standardapi&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd_tag&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;#temp_tag&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DROP&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#temp_tag&lt;/font&gt;  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;This works. Now we need to put PHD_DATA into a temp table. For the reasons mentioned above in anomaly one, neither of the following work:&lt;br /&gt;
&lt;br /&gt;
&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;INTO&lt;/font&gt;   &lt;font color="#800000"&gt;#temp_data&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;standardapi&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd_data&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;  &lt;font color="#800000"&gt;tagname&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; &lt;font color="#800000"&gt;"301GM003FI004.PV"&lt;/font&gt; &lt;br /&gt;
       &lt;font color="#0000ff"&gt;AND&lt;/font&gt; &lt;font color="#800000"&gt;start_timestamp&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; &lt;font color="#800000"&gt;"Now-30"&lt;/font&gt; &lt;br /&gt;
       &lt;font color="#0000ff"&gt;AND&lt;/font&gt; &lt;font color="#800000"&gt;end_timestamp&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; &lt;font color="#800000"&gt;"Now"&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;#temp_data&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DROP&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#temp_data&lt;/font&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;or&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;INTO&lt;/font&gt;   &lt;font color="#800000"&gt;#temp_data&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;your_linkedserver_name&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;standardapi&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd&lt;/font&gt;&lt;font color="#c0c0c0"&gt;.&lt;/font&gt;&lt;font color="#800000"&gt;phd_data&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;  &lt;font color="#800000"&gt;tagname&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; '&lt;font color="#800000"&gt;301GM003FI004.PV'&lt;/font&gt; &lt;br /&gt;
       &lt;font color="#0000ff"&gt;AND&lt;/font&gt; &lt;font color="#800000"&gt;start_timestamp&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; '&lt;font color="#800000"&gt;Now-30'&lt;/font&gt; &lt;br /&gt;
       &lt;font color="#0000ff"&gt;AND&lt;/font&gt; &lt;font color="#800000"&gt;end_timestamp&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; '&lt;font color="#800000"&gt;Now'&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;#temp_data&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DROP&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#temp_data&lt;/font&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Courier New"&gt;or&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;INTO&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; #TEMP_DATA&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;EXEC &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;'SELECT * FROM phd_data WHERE tagname = "301GM003FI004.PV" &lt;br /&gt;
AND start_timestamp = "Now-30" AND end_timestamp = "Now"'&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; at you_linkedserver_name&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;SELECT&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; #TEMP_DATA&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;DROP&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;TABLE&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; #TEMP_DATA&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#808080" size="2"&gt;&lt;br /&gt;
&lt;/font&gt;Using Dynamic SQL doesn't even work for PHD_TAG&lt;br /&gt;
&lt;br /&gt;
&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;DECLARE&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL&lt;/font&gt; &lt;font color="#000000"&gt;&lt;i&gt;NVARCHAR&lt;/i&gt;&lt;/font&gt; &lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;4000&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SET&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; &lt;br /&gt;
&lt;font color="#ff0000"&gt;'EXEC (''SELECT TAGNO FROM phd_tag WHERE tagname = "301GM003FI004.PV" &lt;br /&gt;
AND start_timestamp = "Now-30" AND raw_data = 0 AND end_timestamp = "Now" &lt;br /&gt;
AND sample_interval = 3600000'') at your_linkedserver_name'&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;CREATE&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#tagno&lt;/font&gt; &lt;br /&gt;
  &lt;font color="#800000"&gt;(&lt;/font&gt; &lt;br /&gt;
     &lt;font color="#800000"&gt;tagno&lt;/font&gt; &lt;font color="#000000"&gt;&lt;i&gt;INT&lt;/i&gt;&lt;/font&gt; &lt;br /&gt;
  &lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;INSERT&lt;/font&gt; &lt;font color="#0000ff"&gt;INTO&lt;/font&gt; &lt;font color="#800000"&gt;#tagno&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; &lt;font color="#ff0080"&gt;&lt;b&gt;Sp_executesql&lt;/b&gt;&lt;/font&gt; &lt;font color="#8000ff"&gt;@sql&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;#tagno&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DROP&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#tagno&lt;/font&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;or&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DECLARE&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL2&lt;/font&gt; &lt;font color="#000000"&gt;&lt;i&gt;NVARCHAR&lt;/i&gt;&lt;/font&gt; &lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;4000&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SET&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL2&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; &lt;br /&gt;
&lt;font color="#ff0000"&gt;'EXEC (''SELECT TAGNO FROM phd_tag WHERE tagname = "301GM003FI004.PV" &lt;br /&gt;
AND start_timestamp = "Now-30" AND raw_data = 0 AND end_timestamp = "Now" &lt;br /&gt;
AND sample_interval = 3600000'') at your_linkedserver_name'&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;CREATE&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#tagno&lt;/font&gt; &lt;br /&gt;
  &lt;font color="#800000"&gt;(&lt;/font&gt; &lt;br /&gt;
     &lt;font color="#800000"&gt;tagno&lt;/font&gt; &lt;font color="#000000"&gt;&lt;i&gt;INT&lt;/i&gt;&lt;/font&gt; &lt;br /&gt;
  &lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;INSERT&lt;/font&gt; &lt;font color="#0000ff"&gt;INTO&lt;/font&gt; &lt;font color="#800000"&gt;#tagno&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; &lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#8000ff"&gt;@sql2&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#800000"&gt;#tagno&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DROP&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;#tagno&lt;/font&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;The error returned for the last two is:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: rgb(255,0,0)"&gt;Msg 7390, Level 16, State 2, Line 1&lt;br /&gt;
The requested operation could not be performed because OLE DB provider "PHDOleDB" for linked server "myphdlink" does not support the required transaction interface.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(255,0,0)"&gt;&lt;span style="color: rgb(0,0,0)"&gt;&lt;font size="2" face="Courier New"&gt;Finally, I thought I'd try a memory table:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(255,0,0)"&gt;&lt;span style="color: rgb(0,0,0)"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#0000ff"&gt;DECLARE&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL3&lt;/font&gt; &lt;font color="#000000"&gt;&lt;i&gt;NVARCHAR&lt;/i&gt;&lt;/font&gt; &lt;font color="#800000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;4000&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SET&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL3&lt;/font&gt; &lt;font color="#c0c0c0"&gt;=&lt;/font&gt; &lt;br /&gt;
&lt;font color="#ff0000"&gt;'EXEC (''SELECT TAGNO FROM phd_tag WHERE tagname = "301GM003FI004.PV" &lt;br /&gt;
AND start_timestamp = "Now-30" AND raw_data = 0 AND end_timestamp = "Now" &lt;br /&gt;
AND sample_interval = 3600000'') at your_linkedserver_name'&lt;/font&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;DECLARE&lt;/font&gt; &lt;font color="#8000ff"&gt;@MemoryTable&lt;/font&gt; &lt;font color="#0000ff"&gt;TABLE&lt;/font&gt; &lt;font color="#800000"&gt;(&lt;/font&gt; &lt;br /&gt;
  &lt;font color="#800000"&gt;tagno&lt;/font&gt; &lt;font color="#000000"&gt;&lt;i&gt;INT&lt;/i&gt;&lt;/font&gt;&lt;font color="#800000"&gt;)&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;INSERT&lt;/font&gt; &lt;font color="#8000ff"&gt;@MemoryTable&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; &lt;font color="#ff0080"&gt;&lt;b&gt;Sp_executesql&lt;/b&gt;&lt;/font&gt; &lt;font color="#8000ff"&gt;@SQL3&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; &lt;font color="#c0c0c0"&gt;*&lt;/font&gt; &lt;br /&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;   &lt;font color="#8000ff"&gt;@MemoryTable&lt;/font&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;span style="color: rgb(255,0,0)"&gt;&lt;span style="color: rgb(0,0,0)"&gt;&lt;font size="2" face="Courier New"&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;strong&gt;&lt;span&gt;Anomaly Four: Using SQL Server's Import and Export Wizard to pull data into a relational database table...&lt;/span&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;...doesn't work. It looks like it does right up until you execute the package. When previewing the data within the Wizard, it is using it's own process to view the data. However, when executing the package, a seperate process is created and thus it fails as this isn't supported by the provider. When creating a linked server to a PHD server, there is a "Allow Inprocess" checkbox for the provider offered by SQL Server that allows you to have the query executed using the same process that SQL Server is using. This option however is not available in the Import Export Wizard. You could probably get round this in SSIS, but as I wanted to enable the business by allowing users to create their own reports, I didn't bother going down that route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Conclusion?&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;&lt;/u&gt;Well, compared to standard providers, it's a bit flakey. That said, it's fairly impressive what they've done when you think about it. If you want to get fancy with your reporting using standard techniques without the worry of running into unexpected and painful obstacles and obtuse workarounds, you may want to use PHDTOREL instead (though there are draw backs to this too).&lt;/p&gt;&lt;br /&gt;&lt;a href=http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/5/PHDOLEDB-OLEDB-provider-for-Honeywells-PHD-anomalies.aspx&gt;More ...&lt;/a&gt;&lt;div class="tags"&gt;Tags: phd oledb,sql server,data extraction&lt;/div&gt;&lt;div class="category"&gt;Category: &lt;a href=/About/Blog/tabid/220/CatID/2/Default.aspx&gt;1. Honeywell SCADA&lt;/a&gt;&lt;/div&gt;</description>
      <author />
      <category domain="/About/Blog/tabid/220/CatID/2/Default.aspx">1. Honeywell SCADA</category>
      <comments>http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/5/PHDOLEDB-OLEDB-provider-for-Honeywells-PHD-anomalies.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/5/PHDOLEDB-OLEDB-provider-for-Honeywells-PHD-anomalies.aspx</guid>
      <pubDate>Mon, 03 Jan 2011 13:00:00 GMT</pubDate>
      <trackback:ping>http://www.sqlservermonitor.comDesktopModules/BlogTrackback.aspx?id=5</trackback:ping>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/3/Default.aspx">phd oledb</blog:tag>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/5/Default.aspx">sql server</blog:tag>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/6/Default.aspx">data extraction</blog:tag>
    </item>
    <item>
      <title>PHDTOREL - No SnapShot retrieval type</title>
      <link>http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/3/PHDTOREL-No-SnapShot-retrieval-type.aspx</link>
      <description>&lt;p&gt;It's a little odd, but at the time or writing there is no SnapShot retrieval type available for selection when creating a PHDTOREL query in the PHD Configuration tool (confirmed by Honeywell).&lt;/p&gt;
&lt;p&gt;The values available are&lt;/p&gt;
&lt;p&gt;Average&lt;br /&gt;
Maximum&lt;br /&gt;
Minimum&lt;br /&gt;
Delta&lt;br /&gt;
Raw&lt;br /&gt;
Standard Deviation&lt;br /&gt;
Regression Constant&lt;br /&gt;
Regression Slope&lt;br /&gt;
Regression Deviation&lt;br /&gt;
First&lt;br /&gt;
Last&lt;br /&gt;
Value&lt;br /&gt;
&lt;br /&gt;
The description for Value is the same as Raw; "Requests the raw value", however what is actually does is return the first Raw value for that retrieval period.&lt;br /&gt;
&lt;br /&gt;
Despite SnapShot being available for other APIs such as the .Net Wrapper and the PHD OLEDB providor, it is not available in PHDTOREL. Bit of a pain.&lt;/p&gt;
&lt;p&gt;The closest to it is Average.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;/p&gt;&lt;br /&gt;&lt;a href=http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/3/PHDTOREL-No-SnapShot-retrieval-type.aspx&gt;More ...&lt;/a&gt;&lt;div class="tags"&gt;Tags: phd configuration tool,snapshot&lt;/div&gt;&lt;div class="category"&gt;Category: &lt;a href=/About/Blog/tabid/220/CatID/2/Default.aspx&gt;1. Honeywell SCADA&lt;/a&gt;&lt;/div&gt;</description>
      <author />
      <category domain="/About/Blog/tabid/220/CatID/2/Default.aspx">1. Honeywell SCADA</category>
      <comments>http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/3/PHDTOREL-No-SnapShot-retrieval-type.aspx#Comments</comments>
      <slash:comments>2</slash:comments>
      <guid isPermaLink="true">http://www.sqlservermonitor.com/About/Blog/tabid/220/EntryId/3/PHDTOREL-No-SnapShot-retrieval-type.aspx</guid>
      <pubDate>Mon, 03 Jan 2011 13:00:00 GMT</pubDate>
      <trackback:ping>http://www.sqlservermonitor.comDesktopModules/BlogTrackback.aspx?id=3</trackback:ping>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/12/Default.aspx">phd configuration tool</blog:tag>
      <blog:tag blog:url="/About/Blog/tabid/220/TagID/13/Default.aspx">snapshot</blog:tag>
    </item>
  </channel>
</rss>
