Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

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.

share|improve this question
1  
Good catch. I haven't done any caching of user accounts yet but was planning on doing it this week. –  Mark Henderson Aug 9 '10 at 0:18
    
@far - check this out - stackapps.com/questions/386/… –  Sky Sanders Aug 9 '10 at 4:37

You must log in to answer this question.

Browse other questions tagged .