Question:
Is there any software for importing CSV or text files into SQL Server?
thinkytony
2008-02-10 11:40:26 UTC
Can anyone recommend any utilities for importing CSV or fixed width text file into SQL Server. I'm looking for something that makes a better job of it than Enterprise Manager or Management Studio. I've tried Import Wizard from Beside Software but found it a bit clunky, and wonder if there's anything better available.
Three answers:
Serge M
2008-02-10 13:00:04 UTC
You can use BULK INSERT command to do that.

Read BOL about this command.
2016-05-26 09:50:29 UTC
According to the question on importing the Excel 2007 data to SQL Server 2005, I would like to provide you the suggestions as follows: 1. Connection string issue: Please check if you are able to connect both Excel 2007 and SQL Server 2005 as the data source successfully. The excelConnection seems to be find as you provided. Then you can also add "HDR=YES" to indicate that the first row contains columnnames, not data. "HDR=No;" indicates the opposite. This can avoid the first row confused when importing to the SQL tables. 2. Please test your ODBC SQL Server connection string in order that the connection to SQL Server is correct. Except the ODBC, you can also use SqlConnection and execute the SqlCommand object with the statement that includes the excelConnection in your VB.NET code, but not just integrate the whole in one SQL statement. The following article shows you the way: Import Excel sheet into Table 3. Except the above methods, you can consider to use SqlBulkCopy class to import. The following article shows you the example: Import Excel Spreadsheet Data into SQL Server Database Table Using SqlBulkCopy 4. There is a KB article in MSDN on the topic. Although the article is not applied for SQL Server 2005, you can also learn on SQL Server Data Transformation Services (DTS), Microsoft SQL Server 2005 Integration Services (SSIS), SQL Server linked servers and SQL Server distributed queries. They are helpful on your work. How to import data from Excel to SQL Server Hope that can help you.
2008-02-10 12:14:20 UTC
Not sure what you're trying to do. I use the functions in the java API to accomplish flat files. Sun acquired MySql. java and apache go hand-in-glove. I merely suggest java's built-in CSV parser class because from your question, it sounds like you need custom software.



PS, I realize there are job opportunities in DB, but I have specialized into xml for sanity and for persistence between sessions of my software.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...