dbTalk Databases Forums  

Bulk Insert for data with quotes

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


Discuss Bulk Insert for data with quotes in the microsoft.public.sqlserver.dts forum.



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

Default Bulk Insert for data with quotes - 09-23-2004 , 01:25 AM






Hi
I am new to DTS, I use bulk insert to load a csv file which has all its
character (as opposed to numeric) data in double quotes. But the bulk insert
takes the data into the table along with the quotation marks. I know you can
do this easily in Transform Data Task, but for lot of records I want to use
bulk insert. How can I get bulk insert to recognise double quotes?

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

Default Bulk Insert for data with quotes - 09-24-2004 , 04:35 AM






You have a couple of options

1. Format file (Examples on Google)
2. Clear the " after the event using REPLACE()




Quote:
-----Original Message-----
Hi
I am new to DTS, I use bulk insert to load a csv file
which has all its
character (as opposed to numeric) data in double quotes.
But the bulk insert
takes the data into the table along with the quotation
marks. I know you can
do this easily in Transform Data Task, but for lot of
records I want to use
bulk insert. How can I get bulk insert to recognise
double quotes?
.


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

Default RE: Bulk Insert for data with quotes - 09-29-2004 , 01:09 AM



Thanks for your reply.
1. I have tried the format file and given the double quotes as the text
qulaifier but it still doesnt work.
2. How do I use the REPLACE() ? Can it be used in Bulk inserts?
thanks
Mark

"Allan Mitchell" wrote:

Quote:
You have a couple of options

1. Format file (Examples on Google)
2. Clear the " after the event using REPLACE()




-----Original Message-----
Hi
I am new to DTS, I use bulk insert to load a csv file
which has all its
character (as opposed to numeric) data in double quotes.
But the bulk insert
takes the data into the table along with the quotation
marks. I know you can
do this easily in Transform Data Task, but for lot of
records I want to use
bulk insert. How can I get bulk insert to recognise
double quotes?
.



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

Default Re: Bulk Insert for data with quotes - 09-29-2004 , 02:32 PM



No you cannot use REPLACE in the BULK INSERT. You would have to issue the
statement after import.



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


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

Quote:
Thanks for your reply.
1. I have tried the format file and given the double quotes as the text
qulaifier but it still doesnt work.
2. How do I use the REPLACE() ? Can it be used in Bulk inserts?
thanks
Mark

"Allan Mitchell" wrote:

You have a couple of options

1. Format file (Examples on Google)
2. Clear the " after the event using REPLACE()




-----Original Message-----
Hi
I am new to DTS, I use bulk insert to load a csv file
which has all its
character (as opposed to numeric) data in double quotes.
But the bulk insert
takes the data into the table along with the quotation
marks. I know you can
do this easily in Transform Data Task, but for lot of
records I want to use
bulk insert. How can I get bulk insert to recognise
double quotes?
.





Reply With Quote
  #5  
Old   
Mark
 
Posts: n/a

Default Re: Bulk Insert for data with quotes - 09-30-2004 , 12:51 AM



Thanks Allan for your reply, but why doesn't the bulk insert work with double
quotes as the text qualifier? is it a known issue/bug in DTS?

"Allan Mitchell" wrote:

Quote:
No you cannot use REPLACE in the BULK INSERT. You would have to issue the
statement after import.

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Mark" <Mark (AT) discussions (DOT) microsoft.com> wrote in message
news:4185CF0F-A7DA-4F11-9AD4-BC90BF7B4576 (AT) microsoft (DOT) com...
Thanks for your reply.
1. I have tried the format file and given the double quotes as the text
qulaifier but it still doesnt work.
2. How do I use the REPLACE() ? Can it be used in Bulk inserts?
thanks
Mark

"Allan Mitchell" wrote:

You have a couple of options

1. Format file (Examples on Google)
2. Clear the " after the event using REPLACE()




-----Original Message-----
Hi
I am new to DTS, I use bulk insert to load a csv file
which has all its
character (as opposed to numeric) data in double quotes.
But the bulk insert
takes the data into the table along with the quotation
marks. I know you can
do this easily in Transform Data Task, but for lot of
records I want to use
bulk insert. How can I get bulk insert to recognise
double quotes?
.






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

Default Re: Bulk Insert for data with quotes - 10-02-2004 , 06:24 AM



DTS has nothing to do with it. the BI Task is a wrapper around the BULK
INSERT statement. It does work if you use a format file.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


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

Quote:
Thanks Allan for your reply, but why doesn't the bulk insert work with
double
quotes as the text qualifier? is it a known issue/bug in DTS?

"Allan Mitchell" wrote:

No you cannot use REPLACE in the BULK INSERT. You would have to issue
the
statement after import.

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Mark" <Mark (AT) discussions (DOT) microsoft.com> wrote in message
news:4185CF0F-A7DA-4F11-9AD4-BC90BF7B4576 (AT) microsoft (DOT) com...
Thanks for your reply.
1. I have tried the format file and given the double quotes as the text
qulaifier but it still doesnt work.
2. How do I use the REPLACE() ? Can it be used in Bulk inserts?
thanks
Mark

"Allan Mitchell" wrote:

You have a couple of options

1. Format file (Examples on Google)
2. Clear the " after the event using REPLACE()




-----Original Message-----
Hi
I am new to DTS, I use bulk insert to load a csv file
which has all its
character (as opposed to numeric) data in double quotes.
But the bulk insert
takes the data into the table along with the quotation
marks. I know you can
do this easily in Transform Data Task, but for lot of
records I want to use
bulk insert. How can I get bulk insert to recognise
double quotes?
.








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.