264
Views
4
Comments
Varchar(max) vs Text in MS SQL
Discussion
Hi,

Are there any plans to start using Varchar(max) for sql data types rather than text. According to the Outsystems documentation it looks like if a string goes over 2k characters it gets put in a Text datatype. 

In MS SQL you can have a Varchar up to 8k characters and nVarchar up to 4k characters. Varchar(max) also attempts to fit as much or the the characters into the row up to the 8k limit before creating a BLOB.

Also, the Text data type has been depreciated since Sql 2005.

Edit: Just thinking about it, if you're restricting it to 2k to cater for Oracle's Varchar datatype it seems a bit wrong to restrict all other databases to use the lowest common denominator. Oracles varchar2 can have up to 4k characters and nVarchar2 can have 4k bytes  or up to 4k characters. As far as I remember MySQL's varchar limit is restricted by the 65k byte row limit and the character limit will depend on the character set.
2012-03-16 12-21-09
João Rosado
Staff
Hi Nick,

I'm pretty sure that it is a documentation issue, I'll confirm it and ask for an update.
In MSSql it creates a nvarchar(max) since a couple major versions back. Old tables are not automatically upgraded to the new type.

Regards,
João Rosado
UserImage.jpg
nick rowan
Great thanks João.
2012-03-16 12-21-09
João Rosado
Staff
Hi again,

Just checked it:


:)

Regards,
João Rosado
UserImage.jpg
nick rowan
Ah excellent thank you! 
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.