dbTalk Databases Forums  

Numbers are interpreted as varchar columns by the text file connection

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


Discuss Numbers are interpreted as varchar columns by the text file connection in the microsoft.public.sqlserver.dts forum.



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

Default Numbers are interpreted as varchar columns by the text file connection - 10-02-2004 , 07:54 AM






I am using a Text File (source) connection and the input is a CSV file
and the first row of the file as column headers. When I try to create
a destination table DTS interprets columns which are numbers as a
varchar (255) column but when I save the same .csv file from Excel as
a .xls file and use a .XLS file as the connection with column headers
DTS interprets them correctly as a float or double column.

But I cannot afford to import these files into Excel and save them as
..XLS file.

Please can any of you suggest a workaround how I can overcome this
problem and still get natural interpretation of a number as float or
double without having to import the .csv file into Excel and save it
as .XLS file.

Thanks
Karen

Reply With Quote
  #2  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: Numbers are interpreted as varchar columns by the text file connection - 10-04-2004 , 09:26 AM






Karen,

With Excel connection DTS can read column specifications whereas CSV as you
said is a text file, hence varchar(255) by default. Thank g-d DTS is not as
smart as Excel and would not interpret data types. It is you duty to adjust
them.

Ilya

"Karen Middleton" <karenmiddleol (AT) yahoo (DOT) com> wrote

Quote:
I am using a Text File (source) connection and the input is a CSV file
and the first row of the file as column headers. When I try to create
a destination table DTS interprets columns which are numbers as a
varchar (255) column but when I save the same .csv file from Excel as
a .xls file and use a .XLS file as the connection with column headers
DTS interprets them correctly as a float or double column.

But I cannot afford to import these files into Excel and save them as
.XLS file.

Please can any of you suggest a workaround how I can overcome this
problem and still get natural interpretation of a number as float or
double without having to import the .csv file into Excel and save it
as .XLS file.

Thanks
Karen



Reply With Quote
  #3  
Old   
the guy
 
Posts: n/a

Default Re: Numbers are interpreted as varchar columns by the text file connection - 10-04-2004 , 11:30 AM



if i'm understanding your question correctly, i think your best bet is
to just manually change the column definition from varchar(255) to
float, int, etc. in the create destination table sql statement before
hitting 'ok'. i'm assuming you know which columns should be varchar
vs numeric.

karenmiddleol (AT) yahoo (DOT) com (Karen Middleton) wrote in message news:<a5fd468a.0410020454.7b796251 (AT) posting (DOT) google.com>...
Quote:
I am using a Text File (source) connection and the input is a CSV file
and the first row of the file as column headers. When I try to create
a destination table DTS interprets columns which are numbers as a
varchar (255) column but when I save the same .csv file from Excel as
a .xls file and use a .XLS file as the connection with column headers
DTS interprets them correctly as a float or double column.

But I cannot afford to import these files into Excel and save them as
.XLS file.

Please can any of you suggest a workaround how I can overcome this
problem and still get natural interpretation of a number as float or
double without having to import the .csv file into Excel and save it
as .XLS file.

Thanks
Karen

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.