dbTalk Databases Forums  

Data Type Conversion ?

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


Discuss Data Type Conversion ? in the microsoft.public.sqlserver.dts forum.



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

Default Data Type Conversion ? - 01-23-2005 , 08:32 AM






My application reads Excel data from *.xls file into its DataSet (c# &
Asp.net form). All OK. There are some fields that are of type alphanumeric,
that is VARCHAR(). Is there a way to quickly find the largest field in order
to give VARCHAR() the proper field size ? At present, I have to give it a
maximum of 80 bytes for each VARCHAR field. I sure do not want to use
control loop to loop thru every record/field in the dataset to discover
this.

Another question: When I define a field as "VARCHAR(80)", but my actual data
size is only 9 bytes in length. Will the SQL DB Engine store all 80 bytes in
its file (physically) or just the 9 bytes ?

Thanks for your help,

John



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.