SQL insert from CSV

Oct 3, 2016 at 2:01 PM
Hi i now and then have to do an audit of offline machines in verious locations, they have no network connectivity so only way is to save to CSV, i was wondering if it would be possible to insert them into a SQL DB? the machines that are online and connected to our network i save directly to a SQL DB, but now i have only 70% in the database and the rest external

Oct 4, 2016 at 2:40 PM
Hi mikeg69

No, I'm afraid that is not possible. Before posting records to the database, a few queries are performed involving autoincrements and computer specific identifiers such as UUID and MAC address. Additionally, WinAudit is a simple utility so generally accepts only data received directly via an OS system call, not read in from an external file.

A partial/possible solution if you are willing to use Access would be to take the DB with you on a USB stick. Run WinAudit at the command line specifying a DNS-less connection string, e.g.

WinAudit.exe /r=g /f=DBQ=E:\Audits.mdb;Driver={Microsoft Access Driver (*.mdb)};UID=admin;

The /r switch specifies the categories of information you want to collect and /f specifies the database's path. The drive letter E in this example would need to be determined at runtime. That way when you go to the next site, the autoincrement fields are always up to date and a given computer will be recognised when you re-visit the site.