Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 importing an 'excel looking' csv file.

Author  Topic 

Kimi86
Yak Posting Veteran

79 Posts

Posted - 2014-07-07 : 12:30:09
Hi Folks,
What is a best way to import a .csv file to a sql server table.
The csv file i have been given is not a comma separated text file. It looks like an excel sheet. I am looking for different ways to do this and also would like your suggestion on which method would be the easiest.

Thanks,

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-07-07 : 13:47:07
If it is a plain text file you can use bulk insert or bcp. If it is not or even if it is, you can use SSIS, or one of the other methods described here: http://support.microsoft.com/kb/321686

I usually use bulk insert for plain text files, and SSIS for Excel files. If the plain text file is a true csv file with escape characters (e.g., strings with embedded commas escaped using double quotes) SSIS would be preferable.
Go to Top of Page

Kimi86
Yak Posting Veteran

79 Posts

Posted - 2014-07-07 : 15:20:40
its not a normal comma delimited file.. it looks like an excel formal. I dont have ssis set up on my database... is there any documentation on how to go about this
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-07-07 : 15:47:59
How did you determine that it is an Excel format file? Are you able to open it with Notepad or another plain text editor?

If you don't have SSIS installed you could still try Import/Export Wizard. There are step by step instructions here. http://msdn.microsoft.com/en-us/library/ms140052(v=sql.105).aspx
Go to Top of Page
   

- Advertisement -