varcharmax

My VARCHAR(MAX) field is capping itself at 4000; what gives?

时光怂恿深爱的人放手 提交于 2019-11-28 01:23:01
问题 I have a table in one of my databases which is a queue of emails. Emails to certain addresses get accumulated into one email, which is done by a sproc. In the sproc, I have a table variable which I use to build the accumulated bodies of the emails, and then loop through to send each email. In my table var I have my body column defined as VARCHAR(MAX) , seeing as there could be any number of emails currently accumulated for a given email address. It seems though that even though my column is

Why not use varchar(max)?

谁说胖子不能爱 提交于 2019-11-27 20:57:48
I'm a bit old school when it comes to database design, so I'm totally for using the correct data sizes in columns. However, when reviewing a database for a friend, I noticed he used varchar(max) a lot. Now, my immediate thought was to throw it back to him and tell him to change it. But then I thought about it and couldn't come up with a good reason for him not to use it (he'd used a case type tool to generate the db, if you're wondering). I've been researching the topic of varchar(max) usage and I can't really come up with any good reason for him not to use it. He doesn't use the columns for