views:

49

answers:

2

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?

[update]

i am still condering using MySQL (if PHP 5.3/Zend Framework) or MSSQL (if ASP.NET MVC 2)

+1  A: 

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..

rdkleine
ok. i think [MSSQL Server - varchar(max) vs text](http://stackoverflow.com/questions/834788/ms-sql-server-varcharmax-vs-text "MSSQL Server - varchar(max) vs text") is useful too. what abt if i use MySQL?
jiewmeng
+1  A: 

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

Thomas