• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1967
  • Last Modified:

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
0
Progold S.p.A.
Asked:
Progold S.p.A.
  • 4
  • 2
  • 2
  • +1
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
if you declare the variable as varchar(max), it shall work correctly.
0
 
Scott Fell, EE MVEDeveloperCommented:
Are you using classic asp?  Which version of sql server?
0
 
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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
 
Carl TawnSystems 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:
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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now