I'm generarintg a mail from a trigger, using xp_sendmail.
I use the query parameter to generate the body of the mail, the query is a procedure call with some parameters, one of this is a long string.
when the length is less that 128 work fine, but, when this parameter is longer than 128 charaters, return me the error 103 telling me that it has exceed 128 characteres, and do not send the mail.
I find this quite frustrating, the parameter is limited only to 128 characteres, what could I do.
Thanks in advance
Do not use triggers to send mail.
The scope of triggers should be limited to the table if possible, and the database at the most.
The proper method to do this is to use your trigger to load data into a staging table, and then have a scheduled process that checks for data in the staging table sends appropriate e-mails.
If it's not practically useful, then it's practically useless.