4

I ran into a truncation error while inserting user data into a database using the documented field length (buffer size) of 3000.

So I redefined to nvarchar(max), pulled all users in the stack exchange universe with rep > 100 and checked the field lengths.

Here are the results for Users.

UserType             
-------------------- 
10                   

DisplayName          
-------------------- 
40                   

AboutMe              
-------------------- 
3229                 

Location             
-------------------- 
92                   

WebsiteUrl           
-------------------- 
200                  

EmailHash            
-------------------- 
32                   

I am guessing that the recommended field size for text fields is approximated as it is stored in markdown format but we get it in expanded html which is an arbitrary length.

So, i would recommend adding an extra K for user.about_me, question.body, answer.body and even comment.body.

2

0

You must log in to answer this question.

Browse other questions tagged .