SQLHistorian tag data


I was wondering if it would be possible to export the data contained within an historian tag to an standard SQL table.

Any pointers or advice would be gratefull. :smiley:

Maybe use system.tag.queryTagHistory to export to a dataset?
Then take that dataset out to anything you wanted.

Clkman what exactly do you mean by exporting “the data contained within an historian tag”? Are you trying to grab tag history data contained in Ignition Historian sqlt_data_* tables?

Yes, system.tag.queryTagHistory will work, or you could use a Table component with Tag History binding and then work with its dataset. In either case, you will then want to iterate through the resulting dataset and insert the rows into your database table.

On another note, you can also log tag history in Ignition with a transaction group, which will create a “standard” SQL table (with a t_stamp column followed by data columns). The second half of http://www.inductiveautomation.com/support/usermanuals/ignition/index.html?how_do_i_log_history_for_a_tag.htmuser manual page describes just that.