Reputation: 88189
What data type should I use for data that can be very short, eg. html link (think twitter), or very long eg. html blog post (think wordpress).
I am thinking if I use varchar(4000)
, it maybe too short for a html formated blog entry? but if I use text
, it will take up more space and is less efficient?
i am still condering using MySQL (if PHP 5.3/Zend Framework) or MSSQL (if ASP.NET MVC 2)
Upvotes: 0
Views: 781
Reputation: 11734
If you are using Micrsoft SQL server 2008 you can use varchar(max). Edit: Text is also available but isn't searchable without text indexing..
Upvotes: 1
Reputation: 64635
MySQL also has a Text
data type for storing an arbitrarily large amount of text. You can find more here: The BLOB and TEXT Types
Upvotes: 1