dbTalk Databases Forums  

Bulk Insert comma seperated text file with text qualifiers

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Bulk Insert comma seperated text file with text qualifiers in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
freterink
 
Posts: n/a

Default Bulk Insert comma seperated text file with text qualifiers - 07-08-2004 , 04:40 AM






I want to insert a text file with comma seperated fields. De text-field have text qualifiers:
"field1","field2","field3"
I made a Bulk Insert with FMT file. I choose comma seperated with text qualifiers. In the example screen the data looked perfect. After the insert however the text qualifiers where imported into the colimns as well. (The first column contained "field1" instead of field1)

Does anybody have suggestions on how to solve this?

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Bulk Insert comma seperated text file with text qualifiers - 07-08-2004 , 04:55 AM






There are examples of doing this on Google. You need to build your own
format file OR if you use the Data Transformation task it will strip them
for you as well.



--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"freterink" <freterink (AT) discussions (DOT) microsoft.com> wrote

Quote:
I want to insert a text file with comma seperated fields. De text-field
have text qualifiers:
"field1","field2","field3"
I made a Bulk Insert with FMT file. I choose comma seperated with text
qualifiers. In the example screen the data looked perfect. After the insert
however the text qualifiers where imported into the colimns as well. (The
first column contained "field1" instead of field1)
Quote:
Does anybody have suggestions on how to solve this?



Reply With Quote
  #3  
Old   
freterink
 
Posts: n/a

Default Re: Bulk Insert comma seperated text file with text qualifiers - 07-08-2004 , 06:33 AM



I'm using DTS to insert the text file with a Bulk Insert Task. I als used the button Generate to create a FMT file. This FMT file looks like this:

7.0
12
1 SQLCHAR 0 64 "," 1 col1
2 SQLCHAR 0 64 "," 2 col2
3 SQLCHAR 0 64 "," 3 col3
4 SQLCHAR 0 64 "," 4 col4
5 SQLCHAR 0 64 "," 5 col5
6 SQLCHAR 0 64 "," 6 col6
7 SQLCHAR 0 64 "," 7 col7
8 SQLCHAR 0 64 "," 8 col8
9 SQLCHAR 0 64 "," 9 col9
10 SQLCHAR 0 64 "," 10 col10
11 SQLCHAR 0 64 "," 11 col11
12 SQLCHAR 0 64 "\r\n" 12 col25

In the wizard that creates the FMT file I choose Delimited file with the textqualifier ". These qualifiers are however ignored.

"Allan Mitchell" wrote:

Quote:
There are examples of doing this on Google. You need to build your own
format file OR if you use the Data Transformation task it will strip them
for you as well.



--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"freterink" <freterink (AT) discussions (DOT) microsoft.com> wrote in message
news:6864E4E7-714B-4CE7-BBB4-A907750CDDD4 (AT) microsoft (DOT) com...
I want to insert a text file with comma seperated fields. De text-field
have text qualifiers:
"field1","field2","field3"
I made a Bulk Insert with FMT file. I choose comma seperated with text
qualifiers. In the example screen the data looked perfect. After the insert
however the text qualifiers where imported into the colimns as well. (The
first column contained "field1" instead of field1)

Does anybody have suggestions on how to solve this?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.