dbTalk Databases Forums  

Tilda separated fields - normal behavior?

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


Discuss Tilda separated fields - normal behavior? in the microsoft.public.sqlserver.dts forum.



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

Default Tilda separated fields - normal behavior? - 03-07-2005 , 03:08 PM






Hello

I am querying a table and outputting data to a text file where each field is
separated by a tilda (~) . It works great. I notice that sometimes when
the fields have no data in them I get two tildas in a row (~~) which is what
I want. However, sometimes I get a field of blanks separated by the tildas
(~ ~) which is not what I want. There aren't hard spaces in those
data columns in the database. Is there a cute way in the transformation
process to give me the back to back tildas when there is no data in the
field?

Thanks everyone.



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Tilda separated fields - normal behavior? - 03-07-2005 , 05:32 PM






In message <3p3Xd.14697$Cg6.9327 (AT) twister (DOT) rdc-kc.rr.com>, Steve
<pezguy (AT) mn (DOT) rr.com> writes
Quote:
Hello

I am querying a table and outputting data to a text file where each field is
separated by a tilda (~) . It works great. I notice that sometimes when
the fields have no data in them I get two tildas in a row (~~) which is what
I want. However, sometimes I get a field of blanks separated by the tildas
(~ ~) which is not what I want. There aren't hard spaces in those
data columns in the database. Is there a cute way in the transformation
process to give me the back to back tildas when there is no data in the
field?

Thanks everyone.


There must be a reason for the spaces in the output.

There is data in those fields, check the length with LEN or similar in
T-SQL, spaces may not be visible in your query tool.

Or

The fields maybe fixed width (char) and the output driver treats this
similar to other data access, where by the date in the fields is treated
as padded if < the full length. (Guess really as untested).

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.