I have a stored procedure in a SQL Server 2005 database that creates the body of an email message. The result of this procedure should be placed in a table with the TEXT field for the message body for further processing.
The problem I am facing is that in some scenarios the generated email is more than 8000 characters. Therefore, I cannot create a message body in a TEXT variable, because SQL Server does not allow TEXT type variables. I can copy the parts of the email into a table variable, but it does not solve the problem, because I can not add these parts of the email together in one variable to paste into the result table.
Is there a way (1) to manipulate objects larger than 8000 in memory, or is there a (2) way for me to accumulate values in a field of a (temporary) table in a text field?
source
share