Thursday, 30 May 2013

Insert excel data into MySql Table






1. First save the data in excel file in the .csv format.
2. For example execute a select query that returns more than 100 rows. And there is export option in result panel. Using that export as CSV file format.

From that file execute the below line to insert.
 
 LOAD DATA LOCAL INFILE 'C:\\temp\\dlyhdr.csv' INTO TABLE tt.dailystockheader
 FIELDS TERMINATED BY '\t'
 ENCLOSED BY '' LINES TERMINATED BY '\n' ;
 

Then select that table whether data has inserted or not.

No comments:

Post a Comment