April 11, 2008 at 1:36 pm
Greetings folks. I have a procedure for emailing, where there is a variable to house the content of the body, @body VARCHAR(1000). I saw where one of the emails on a particularly busy day of production was truncated, so I went to adjust the legnth of @body to 4000, and just for fun I copied the entire body of the email, then queried SELECT LEN('my pasted email body'). Lo and behold, the length was 1016. How is this possible if I have explicitly declared the variable to be 1000?
Greg
Greg
_________________________________________________________________________________________________
The glass is at one half capacity: nothing more, nothing less.
April 13, 2008 at 6:12 pm
LEN does not include trailing spaces... try the same thing with DATALENGTH.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 14, 2008 at 7:52 am
Jeff, same thing with DATALENGTH. Its not a big deal, just one of those things I don't get. I don't know if it matters, but when I copied and pasted the text from the body of the email, the blue background extended 6 spaces past the end of the truncated text.
Greg
Greg
_________________________________________________________________________________________________
The glass is at one half capacity: nothing more, nothing less.
April 14, 2008 at 10:35 am
Greg... stupid question on my part, but have you tried using RTRIM to get rid of the trailing spaces?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply