This is a discussion on How to insert data from a csv file into a SQL server database? within the Database Support forums, part of the Web Development category; I am having a csv file with comma (,) seperated values having some 3 lakh records in it. I have to ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| I am having a csv file with comma (,) seperated values having some 3 lakh records in it. I have to insert it into the database. Is it possible to insert the data from csv file to database? If so, how? Can anyone help me....
__________________ $enthil |
| Sponsored Links |
| |||
| Yes...we can insert the data from csv using bulk insert for example -- insert the data bulk insert [dbo].[tablename] from '<<ToDo: add path to sample.csv>>' with ( fieldterminator = ',', rowterminator = '\n' ) GO |
| |||
| Quote:
Can we able to import data from Excel / Text (Tab Delimited) file into SQL server ? What are all the file types SQL server supports for import data ?
__________________ Keep smiling... |
| |||
| Quote:
Import from EXCEL file: Follow the steps 1. Right click the database--> Tasks--> Import Data 2. Select the Datasource from the drop down and click next For excel, select Microsoft excel For text and csv files, select Flat File source 3. Select destination database and table to insert the data from the file to db Supported file types: 1. xls 2. csv 3. txt 4. mdb The above files i have tested..
__________________ $enthil |
| |||
| Hi, Thanks for your reply.. Can you please provide the command line syntax for importing XLS and MDB file into SQL Server.
__________________ Keep smiling... |
| |||
| Try this query to bulk insert data from a file syntax: Quote:
Quote:
__________________ $enthil |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Insert Multiple records using single Insert Statement | vadivelanshanmugam | Database Support | 0 | 03-04-2008 09:26 PM |
| example of Inserting and Retrieving data from xml file | hanusoft | ASP and ASP.NET Programming | 1 | 11-12-2007 04:13 AM |
| Copy SQL data structures from one SQL server to another SQL server? | arjkhanna | Server Management | 5 | 11-05-2007 02:57 AM |
| reading data from a file using C# | oxygen | C# Programming | 2 | 08-23-2007 12:48 AM |
| Data and Database Integrity Testing | sudhir | Software Testing | 1 | 04-01-2007 08:35 PM |