dbTalk Databases Forums  

DTS export to CSV file

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


Discuss DTS export to CSV file in the microsoft.public.sqlserver.dts forum.



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

Default DTS export to CSV file - 04-20-2005 , 02:04 PM






Hi,
I have one table and i m trying to export it to .CSV file. i do have NULL
values in
one of column of table so when i do export to csv file, it convert into
single quote..
like following

TABLE:

col1 col2
test 1
NULL 2
test2 3
NULL 4


when i do export to csv file through, it converts NULL values into single
quote, it export like following.

'test',1
'',2
'test2',3
'',4

can i know how can i avoid that single quote for NULL values, when i do
export to csv file.

Pls let me know.


Reply With Quote
  #2  
Old   
Denis
 
Posts: n/a

Default Re: DTS export to CSV file - 04-21-2005 , 08:21 AM






It is not a single quote but an empty space surrounded by quotes
look up coalesce in BOL
use like coalesce(col1,'SomeValue') replace 'SomeValue' with the data you
want



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

Quote:
Hi,
I have one table and i m trying to export it to .CSV file. i do have NULL
values in
one of column of table so when i do export to csv file, it convert into
single quote..
like following

TABLE:

col1 col2
test 1
NULL 2
test2 3
NULL 4


when i do export to csv file through, it converts NULL values into single
quote, it export like following.

'test',1
'',2
'test2',3
'',4

can i know how can i avoid that single quote for NULL values, when i do
export to csv file.

Pls let me know.




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

Default Re: DTS export to CSV file - 04-21-2005 , 11:42 AM



I do not understand what r u trying to say. i have read abt coalesce in BOL..
but not clear...

I want something like following.

TABLE:

col1 col2
test 1
NULL 2
test2 3
NULL 4

when i export i do not want empty string in case of NULL in col1. so i want
something like following.

'test',1
,2
'test2',3
,4

pls let me know.

"Denis" wrote:

Quote:
It is not a single quote but an empty space surrounded by quotes
look up coalesce in BOL
use like coalesce(col1,'SomeValue') replace 'SomeValue' with the data you
want



"mvp" <mvp (AT) discussions (DOT) microsoft.com> wrote in message
news:F912AC18-81D6-4CC5-95AF-E00D74802F0C (AT) microsoft (DOT) com...
Hi,
I have one table and i m trying to export it to .CSV file. i do have NULL
values in
one of column of table so when i do export to csv file, it convert into
single quote..
like following

TABLE:

col1 col2
test 1
NULL 2
test2 3
NULL 4


when i do export to csv file through, it converts NULL values into single
quote, it export like following.

'test',1
'',2
'test2',3
'',4

can i know how can i avoid that single quote for NULL values, when i do
export to csv file.

Pls let me know.





Reply With Quote
  #4  
Old   
Denis
 
Posts: n/a

Default Re: DTS export to CSV file - 04-21-2005 , 02:49 PM



I don't think you can't since you are exporting from a varchar field you
will always have quotes
test becomes 'test'
NULL becomes ''

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

Quote:
I do not understand what r u trying to say. i have read abt coalesce in
BOL..
but not clear...

I want something like following.

TABLE:

col1 col2
test 1
NULL 2
test2 3
NULL 4

when i export i do not want empty string in case of NULL in col1. so i
want
something like following.

'test',1
,2
'test2',3
,4

pls let me know.

"Denis" wrote:

It is not a single quote but an empty space surrounded by quotes
look up coalesce in BOL
use like coalesce(col1,'SomeValue') replace 'SomeValue' with the data
you
want



"mvp" <mvp (AT) discussions (DOT) microsoft.com> wrote in message
news:F912AC18-81D6-4CC5-95AF-E00D74802F0C (AT) microsoft (DOT) com...
Hi,
I have one table and i m trying to export it to .CSV file. i do have
NULL
values in
one of column of table so when i do export to csv file, it convert into
single quote..
like following

TABLE:

col1 col2
test 1
NULL 2
test2 3
NULL 4


when i do export to csv file through, it converts NULL values into
single
quote, it export like following.

'test',1
'',2
'test2',3
'',4

can i know how can i avoid that single quote for NULL values, when i
do
export to csv file.

Pls let me know.







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.