import data from csv to sql

import data from csv to sql

Hello,

Some time ago, we had a zenon supervisor version 7.20 running and archiving data. The data was stored as csv files.
Later, we changed to sql evacuation.
Now, we are running 7.60 and the customer ask us to insert thee data that is in those csv.
the data in the csv is like this:

01/01/2016;0:46:00.0;B0002V.Health;0.0;SPONT

The new project is new, has his own new variables that correspond to the old ones (same IED, but diferent variable name). So i created in the new project an archive structure similar to the old one, with evacuation to sql. then, a c# program that, with the variables table from both projects, generates a csv file in the Zenon format. This file has lines like this:

62;0;1451606400;0;413712270;4325376;0;

Then i bulk insert the file in the sql table (10.000.000 records).
I did this twice. In the first one, i used the same old project with a new archive for importing, and i could view the data in a report viewer type screen.
The second one, i created a brand new project witch archive with the same configuration and inserted the data, but i can't see the data in a report viewer screen.
¿Why this happens?, ¿Perhaps Zenon needs to create some new data to access the old one?.
Aditionally, when generating the zenon format record, i use as status the string '4325376'. This has worked for me before, but i do not really knowwhat statuses to use (i saw this in the records created by a normal zenon evacuation, so i used it).
¿What is the recommended method for inserting the data from external sources in the historic sql table?, ¿There is a manual that i can read?

I hope i have explained myself, thank you in advance




This is a migrated post! Originally posted on 23.05.2018 by user redjon. Please be aware that information can be outdated.