I have a stored SQL procedure that sends mail. His signature is as follows:
CREATE PROCEDURE SendMail
@From varchar(40),
@To varchar(255),
@Subject varchar(255),
@Body varchar(max),
@CC varchar(255) = null,
@BCC varchar(255) = null
AS...
When a message contains, for example, 5000 characters, it works. When it is 12,000, I get an error[ODBC SQL Server Driver]String data, right truncation.
According to the help files, varchar (max) can process 2 ^ 31-1 bytes / characters. So I tried changing @Body varchar(max)to @Body varchar(30000), and I get an error message that
The size (30000) given to the type 'varchar' exceeds the maximum allowed for any data type (8000).
So max is 8000, not 2 ^ 31-1 bytes? How can I handle more than 8000 characters?
source
share