Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LOAD SQL Table from flat file

I am am trying to load a SQL table from a flat file. The flat i am talking about is a comma separated file. This has all the data required to populate a table will each column separated by a comma ",". I need some way by which i can load this content into the table faster.

like image 757
Vinod Avatar asked Dec 06 '25 04:12

Vinod


2 Answers

If you are using SQL Server, use BULK INSERT

If you are using Oracle, see my answer here

like image 84
Galwegian Avatar answered Dec 08 '25 16:12

Galwegian


Regardless of what database management system you are using, you could use a scripting language (such as perl or php) to set up a connection to your database, parse the file, and then insert the data into your database. Of course, you would have to know a scripting language...

like image 45
Steven Oxley Avatar answered Dec 08 '25 16:12

Steven Oxley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!