473,320 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

bulk insert rowterminator issue

I'm running a bulk insert like this:
Code:

Expand|Select|Wrap|Line Numbers
  1. BULK INSERT Descriptions
  2. FROM '......\Descriptions.txt' 
  3. WITH (FIELDTERMINATOR = '\t',
  4.       ROWTERMINATOR ='\n')
The file is a tab delimited file with two columns, item name and description

One of the descriptions in the file goes over 2 lines (enclosed in quotes) and it's messing things up.How can I work with this?
ex:
item1 description1
item2 "description2...............
...continued description2......"
item3 description3.......

Thanks.
Jul 26 '11 #1

✓ answered by Rabbit

You can't. The file is out of format. Bulk insert does not have an option to ignore everything within string delimiters. The file will have to be fixed by getting rid of that line break.

6 2589
Rabbit
12,516 Expert Mod 8TB
You can't. The file is out of format. Bulk insert does not have an option to ignore everything within string delimiters. The file will have to be fixed by getting rid of that line break.
Jul 26 '11 #2
Thank you. Do you know how I can do that or how I can just disregard that line?
Jul 26 '11 #3
Rabbit
12,516 Expert Mod 8TB
Open the file in notepad and then delete the line break.
Jul 26 '11 #4
Any workaround programmatically?
Thank you.
Jul 26 '11 #5
Rabbit
12,516 Expert Mod 8TB
You could create a script that will delete any new line characters between sets of double quotes. You could use whatever scripting language is handy to you: javascript, vb script, perl, etc. Whatever you're comfortable with. Then you would just have to run the file through the script before running the bulk insert.

And if you wanted to, you could probably do it through an SSIS package, but I believe that limits to you VB.net for coding purposes.
Jul 26 '11 #6
Thank you for your help. I feel comfortable using ssis packages and will look into it.
Jul 26 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Drew | last post by:
I am trying to use Bulk Insert for a user that is not sysadmin. I have already set up the user as a member of "bulkadmin". When I run the following script: DECLARE @SQL VARCHAR(1000) CREATE...
5
by: me | last post by:
I'm also having problems getting the bulk insert to work. I don't know anything about it except what I've gleened from BOL but I'm not seeming to get anywhere...Hopefully there is some little (or...
2
by: Mike Husler | last post by:
We have created CSV files on HPUX 11.0 and transferred them via ASCII ftp to our SQL Server machine file store to load large amounts for data using the BULK INSERT command. This is the command: ...
1
by: Mike | last post by:
I am trying to use the 'Bulk Insert' command to load a data file into a MS-SQL db. The line I am using is: Bulk Insert SVC_Details From "C:\XFILE.TXT" With (FieldTerminator = ',') I have tried...
10
by: Daniel P. | last post by:
How can I use ADO.NET to insert lots of records in a very fast way? Thanks!
11
by: Ted | last post by:
OK, I tried this: USE Alert_db; BULK INSERT funds FROM 'C:\\data\\myData.dat' WITH (FIELDTERMINATOR='\t', KEEPNULLS, ROWTERMINATOR='\r\n');
0
by: rshivaraman | last post by:
BULK INSERT bill_tbl FROM 'd:\ftp_Data\in\baddress.dat' WITH ( FIELDTERMINATOR = ';', ROWTERMINATOR = '\n' ) --------------------------------- This is the query used to populate bill_tbl....
2
by: leedo | last post by:
Hi, I have two tables. Employees and departments as follows: Employees - Name - Salary - Department ID
2
by: jthep | last post by:
How can I use bulk insert to insert a text file where the columns in the text file is in different order than the columns in the table? I have a ZIP table with Zip_Code, Zip_City, Zip_State and...
2
by: zswanson | last post by:
Hi everyone, I receive a variety of text based files that seperates each row by a single delimiter, usually '~'. I use BULK INSERT to transfer the file from a text file to a temporary table. It...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.