Solved

row terminator in Bulk Insert SQL Server 2005

Posted on 2011-03-10
7
806 Views
Last Modified: 2012-05-11
i get an extract daily via ftp that was a text file that is now compressed and having a .gz extension and is now binary. my bulk insert was working without a ROWTERMINATOR when it  was a .txt file, but since its been .gz I get
Msg 4866, Level 16, State 1, Line 1
The bulk load failed. The column is too long in the data file for row 1, column 33. Verify that the field terminator and row terminator are specified correctly.

I added a ROWTERMINATOR = '\r\n' to no avail. The file is an extract from Oracle. I can import the file into access no problem. Any help is appreciated.

Thanks,

Jim
0
Comment
Question by:jmoss111
  • 4
  • 3
7 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 35098558
.gz is a compressed file -- you need to un-compress it first using the gzip command like this:

  gzip.exe  -d  myfile.gz
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 35098568
Run the above from a command prompt in the same folder where your file resides.  If you don't have gzip.exe you can download it from several places - just google.
0
 
LVL 18

Author Comment

by:jmoss111
ID: 35098587
yes i do uncompress the file and i have the problem with the extracted .txt file and not by trying to load the .gz file

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 33

Expert Comment

by:knightEknight
ID: 35099629
I'm guessing then that the file comes from a unix/linux environment.  Have you tried setting ROWTERMINATOR='\n'   or  ROWTERMINATOR='\r'  ?
0
 
LVL 18

Author Comment

by:jmoss111
ID: 35103934
the file did come from unix/Oracle and i tried ROWTERMINATOR = '\r\n'  and ROWTERMINATOR = '\n' and ROWTERMINATOR = '\r'
0
 
LVL 18

Accepted Solution

by:
jmoss111 earned 0 total points
ID: 35109677
i downloaded todos.exe and ran that against my files... problem solved
0
 
LVL 18

Author Closing Comment

by:jmoss111
ID: 35145516
i found a workable solution
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question