March 9, 2009 at 12:28 pm
Hi Everyone,
I have a field which is currently set to varchar(4000), unfortunately this was mis-specified and it turns out that we need to change the data type or limit to allow 10000 characters. The field is used to store blog-style entries which include html code, hence the reason for the large limit. I am using SQL 2005.
Please can you recommend a datatype that I should use, from reading around I think that either 'varchar(max)' would be ok or possibly 'text' however i have seen reports that the latter is going to be phased out.
Feel free to correct me if I am wrong and make a suggestion.
Many Thanks,
David
March 9, 2009 at 12:29 pm
Varchar(max), definitely. Unless you need non-Latin characters, then NVarchar(max). (That's for things like Chinese characters, Greek letters, etc.)
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 9, 2009 at 8:07 pm
AS suggested varchar(max) is your best choice for large data types, nvarchar(max) if you are willing to use any national/unicode characters.
March 10, 2009 at 2:44 am
Thanks very much guys, I will proceed with an nvarchar(max) then!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy