sql - Handling performance and using data types -


i have web forms contain approx 100 150 text fields. so, in of fields user can enter great amount of string data. had entered varchar(150), not large enough.

so, question is, better use: varchar(max) or text? using sql server 2008 r2.

there many related questions available on stack overflow, still confused. assuming web forms more 50 fields text datatype, cause performance-related issues, or make our db large? thought varchar(max) store 8000 characters maximum, have fields can have more 8000 characters.

please guide...

if you're using sql server 2005 or newer use varchar(max). text datatype deprecated , should not used new development work.

see also: http://msdn.microsoft.com/en-us/library/ms187993%28v=sql.90%29.aspx

to answer questions in comments: 8000 maximum can enter in default varchar(x) type. because can maximum 8000 characters in 'data-page'. varchar(max) can store 2^31-1 bytes @doug_ivison allready mentioned. consequently amount of characters greater 8000 you'll need multiple pages contain data. same valid 'text' type. need multiple pages amount of data. please don't use text. besides fact it's deprecated doesn't support things varchar(max) does, ability search & index.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -