tags:

views:

41

answers:

2

Hi guys, I have a table where fields are 40 varchars long, but from time to time I would have to store text ( 250-1000 characters long ) there. What would be the best solution, to try and fit it into the table or just make a separate text file associated with each table?

Thanks!

+3  A: 

You should use the text type instead of varchar there.

Sarfraz
+3  A: 

Better to keep everything in the database, then you don't have to jump through loops when accessing the database remotely ( or when doing backups )

Anders K.
but is it reasonable to make a DATA field, say, 1000+ characters long, if 95% of the time it won't contain more then 40 characters?
@ user296516: a varchar(2048) field takes no more (read: very little, if any, so ignore delta ) space than a varchar(40) field when you store 40char into it. Anders is correct +1 from me!
lexu
yes, you're right! I changed varchar from 40 to 500 and the DB size didn't even change! :) Thanks man!