[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

row terminator in Bulk Insert SQL Server 2005

Posted on 2011-03-10
7
Medium Priority
?
834 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
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.
Suggested Courses

872 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