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
 Transact-SQL (2012)
 Problem in bulk import of text files in SQL Server

Author  Topic 

nitinchauhan
Starting Member

1 Post

Posted - 2014-04-02 : 07:09:05
Hi,

I am using sql server 2012 and trying to import some text files (tab/ comma separated) and ms access files in sql server tempdb

I am trying bulkinsert on text file but it is creating a single line in sql while in text file I have 1000K lines,

Then I tried importing other data using openrowset from access file but I am getting following error

Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".

can any one please provide some assistance . If I am able to upload the data from flat text file then it will be enough as I am getting data in tsv or csv format

Nitin

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-04-02 : 08:30:18
Your text file probably has some other type of row terminator other than what bulk insert is expecting. By default bulk insert expects \r\n. Sometimes you see files with only \n (or is it \r) as row terminator - usually when the file is generated on a unix system. Examine the file using a binary text editor (TextPad for example) to find what the row terminator is, and then use the ROWTERMINATOR parameter in your bulk insert. See documentation here: http://technet.microsoft.com/en-us/library/ms188365.aspx

As for openrowset, I can't offer any useful suggestions unless you post the exact command you are using. I am suspecting something incorrect in the parameters, but I just don't know.
Go to Top of Page
   

- Advertisement -