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 |