<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Timestamp in datalogger SQL - Kepware in Kepware</title>
    <link>https://www.ptcusercommunity.com/t5/Kepware/Timestamp-in-datalogger-SQL-Kepware/m-p/1051823#M3311</link>
    <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;Basically I'm trying to log data into an SQL server, I get the correct tag value and tag name, but with the time I'm not able to see it correctly in SQL&amp;nbsp;&lt;BR /&gt;In SQL I have the column Time as data type: timestamp&lt;/P&gt;&lt;P&gt;and the data that logs is in hexadecimal, so is not what I want&lt;/P&gt;&lt;P&gt;I've actually use data type datetime2 as well in sql but then I get an error in Kepware (Error Data Logger Plug-in Unable to query recordset on Log Group 'loggroup'. Reason: Conversion failed when converting date and/or time from character string)&lt;/P&gt;&lt;P&gt;You can see it in the snapshots&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does anyone know how can I actually submit the time in the SQL server? or like what datatype should be in Kepware and SQL? please help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jan 2026 20:00:19 GMT</pubDate>
    <dc:creator>FG_11085366</dc:creator>
    <dc:date>2026-01-21T20:00:19Z</dc:date>
    <item>
      <title>Timestamp in datalogger SQL - Kepware</title>
      <link>https://www.ptcusercommunity.com/t5/Kepware/Timestamp-in-datalogger-SQL-Kepware/m-p/1051823#M3311</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;Basically I'm trying to log data into an SQL server, I get the correct tag value and tag name, but with the time I'm not able to see it correctly in SQL&amp;nbsp;&lt;BR /&gt;In SQL I have the column Time as data type: timestamp&lt;/P&gt;&lt;P&gt;and the data that logs is in hexadecimal, so is not what I want&lt;/P&gt;&lt;P&gt;I've actually use data type datetime2 as well in sql but then I get an error in Kepware (Error Data Logger Plug-in Unable to query recordset on Log Group 'loggroup'. Reason: Conversion failed when converting date and/or time from character string)&lt;/P&gt;&lt;P&gt;You can see it in the snapshots&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does anyone know how can I actually submit the time in the SQL server? or like what datatype should be in Kepware and SQL? please help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jan 2026 20:00:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Kepware/Timestamp-in-datalogger-SQL-Kepware/m-p/1051823#M3311</guid>
      <dc:creator>FG_11085366</dc:creator>
      <dc:date>2026-01-21T20:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp in datalogger SQL - Kepware</title>
      <link>https://www.ptcusercommunity.com/t5/Kepware/Timestamp-in-datalogger-SQL-Kepware/m-p/1057915#M3317</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a &lt;STRONG&gt;SQL column type mapping issue&lt;/STRONG&gt;, not a bad timestamp from Kepware.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kepware DataLogger writes the timestamp as a &lt;STRONG&gt;database datetime field&lt;/STRONG&gt;, but in your table the &lt;CODE&gt;Time&lt;/CODE&gt; column is being detected as &lt;CODE&gt;SQL_UNKNOWN_TYPE&lt;/CODE&gt;, so the driver falls back to writing the raw value, which is why SQL shows the hex format. That is also why &lt;CODE&gt;datetime2&lt;/CODE&gt; throws a conversion error. Kepware is not recognizing that column properly through the SQL driver.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The clean fix is:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Change the SQL column type to &lt;STRONG&gt;DATETIME&lt;/STRONG&gt; instead of &lt;CODE&gt;timestamp&lt;/CODE&gt; or &lt;CODE&gt;datetime2&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Recreate or refresh the table mapping in the DataLogger so Kepware re-reads the schema&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Make sure the &lt;STRONG&gt;Timestamp Field&lt;/STRONG&gt; in Kepware maps to that &lt;CODE&gt;DATETIME&lt;/CODE&gt; column&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If needed, use an &lt;STRONG&gt;ODBC DSN / SQL Native Client driver&lt;/STRONG&gt; that correctly exposes SQL Server datetime types to Kepware&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In short, for SQL Server, &lt;STRONG&gt;use &lt;CODE&gt;DATETIME&lt;/CODE&gt; for the Kepware timestamp column&lt;/STRONG&gt;. &lt;CODE&gt;timestamp&lt;/CODE&gt; in SQL Server is actually a binary rowversion type, not a real date/time field, which is exactly why you are seeing hex values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 09:24:58 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Kepware/Timestamp-in-datalogger-SQL-Kepware/m-p/1057915#M3317</guid>
      <dc:creator>pshashipreetham</dc:creator>
      <dc:date>2026-03-10T09:24:58Z</dc:date>
    </item>
  </channel>
</rss>

