Syndicate

Convert online CSV to SQL query Print E-mail
Written by Stanislav Duben   
Friday, 20 July 2007
Sample ImageHere is simple online convertor from CSV to SQL. You just insert CSV data to text area and table name. Script will generate SQL insert query for all records from CSV.


Quote this article on your site | Views: 3085 | Print

  Comments (4)
RSS comments
 1 Written by This e-mail address is being protected from spam bots, you need JavaScript enabled to view it , on 23-04-2008 12:52
Your instructions fail to mention that the first row of the CSV should be the field names for each of the fields.
 2 Written by Stanislav Duben website, on 23-04-2008 13:09
Hi Jeff,  
you are right, this is really simple script to convert CSV without column names in first row. I will modify it in future to get better results. Thanks for you note.
 3 Written by This e-mail address is being protected from spam bots, you need JavaScript enabled to view it , on 23-04-2008 14:45
Hi, thanks for the script. I have a problem, however, because the script is not enclosing the data to be inserted in single quotes as shown below: 
 
VALUES ('16,16,category,,0,18');
 4 Written by Stanislav Duben website, on 23-04-2008 14:52
Hi phil, can you give me few rows of CSV Data and specify if you are generating code for MySQL or MSSQL? I will take a look where is problem and fix script.

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site. Such material will be removed.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
E-mail
Homepage
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:

MathGuard security question, please solve:

WJR         XKD      
  4    Q    M     T81
TDW   LQN   HJH      
  B    C    S Q   L8B
L7L         IYE      

Powered by AkoComment Tweaked Special Edition v.1.4.6
AkoComment © Copyright 2004 by Arthur Konze - www.mamboportal.com
All right reserved

Tag it:
Delicious
Digg
YahooMyWeb
Technorati