No of visitors who read this post: 302
Category: Database
Type: Question
No votes yet

I have more than 100k information in my spreadsheet and need to be put on my database.

Can anyone know how to Import MS-excel (.csv format) to my data base (mysql)?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

# (Solution Accepted)

Hello Arquelo.

Welcome to techyv.com!

Please run the sample SQL script below to import your CSV file to your MySQL table.

The example below assumes the following:

1.  Your csv file is named "mytable.csv" with 3 columns of data.

2.  The table you want to import the csv to is "tblMyTable".

3.  The table "tblMyTable" has 3 colums named "Column1", "Column2" and "Column3".

Just replace everything with the actual file name, table names, column names and other information for your particular need.

--- start of code snippet ---

load data local infile 'mytable.csv' into table tblMyTable
fields terminated by ','
(Column1, Column2, Column3)

--- end of code snippet ---

Hope this helps you out!

#

Importing data from Microsoft Excel to SQL Server is done when the user decided to transfer his files from Excel worksheet to the Microsoft SQL Server Data. To do the process, the user must have the following recommended software, hardware, service packs, and network infrastructures. The lists below are the requirements:

  1. Available instance of SQL Server 7.0, 2000, or 2005.
  2. Visual Basic 6.0 for ADO samples

It is also important that the user who is going to do the process should be familiar with:

  1. ADO development in Visual Basic
  2. Linked Servers and Distributed Queries
  3. Data Transformation Services

For further assistance regarding this process, you may visit support.microsoft.com/kb/321686.

Tanok Bloran