body longer than 8000 in sql sp_send_dbmail?

Is there a way to send a may using sql if the body is html format long more than 8000 chars?
I have a store procedure that creates automatically the text and sends to operator.
Quite often the text is longer than 8000chars

Than you
Progold S.p.A.IT ManagerAsked:
Who is Participating?
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
The @body parameter for sp_senddb_mail is NVARCHAR(MAX), so there shouldn't be a limitation in the mail sending part itself - which would suggest the problem lies elsewhere.

Can you post the code you are using to generate the body of your message, and send it?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
if you declare the variable as varchar(max), it shall work correctly.
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Are you using classic asp?  Which version of sql server?
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Progold S.p.A.IT ManagerAuthor Commented:
It doesn't work with varchar(max)
I tried and the email has been sent truncated with 8153 chars
0
 
Progold S.p.A.IT ManagerAuthor Commented:
sql server 2008 R2
I'm not using asp but a sql job with a store procedure
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I agree, it has to work, unless somewhere in the "middle" you use varchar/nvarchar without the MAX specification ...
0
 
Progold S.p.A.IT ManagerAuthor Commented:
thank you. it's working now
0
 
Carl TawnSystems and Integration DeveloperCommented:
Can you expand on what your problem was in the end?

If it was related to a variable somewhere then I think a point split may have been more appropriate option for closing the question.
0
 
Progold S.p.A.IT ManagerAuthor Commented:
I had a intermediate store procedure which launched sp_send_dbmail.
I deleted it and use directly sp_send_dbmail with the correct nvarchar(max)
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.