Perceptus Solutions Inc. » blog | Bingo Card Generator | Papaya Polls - Simple Surveys | Naque for Unique Names | other

The Excel-to SQL INSERT Commands Text Wizard!

This tool will take specifically formatted data that is copy and pasted from Excel (and possibly other spreadsheet programs) and convert them into SQL INSERT commands.

The format that you MUST follow is this:
 Line one has the table name only.
 Line 2 is a tab separated list of field names.
 Lines 3+ are tab separated data rows.

For example:

types color size
golden yellow's my favorite colour large
mac reddish medium
golden red varies
gala yellowish small


		INSERT INTO apple (types,color,size) VALUES ('golden','yellow\'s my favorite colour','large');
		INSERT INTO apple (types,color,size) VALUES ('mac','reddish','medium');
		INSERT INTO apple (types,color,size) VALUES ('golden','red','varies');
		INSERT INTO apple (types,color,size) VALUES ('gala','yellowish','small');

The original goal of this tool was to abstract and simplify exporting data from Excel to a database (MySQL specifically). ODBC and fancy DB GUIs are nice but regular SQL can be used anywhere. If you have a table in Excel with the proper column headings, all that you need to do is copy and paste the data and column headers into the data entry text box below AND insert a row at the top with just the table name.

Note: This tool is FAR from perfect. It does not handle dates at all, every field value is put in quotes (which does not work with some databases), and more.

Enter the text block: