December 31, 2024 at 2:56 pm
Hello SSC!
I hope everyone had a great holiday! Happy New Year to all!
Issue:
I am currently using SQL Agent to send emails when a job succeeds or fails. The process is basically a bunch of SSIS packages. I also have an attachment that is the results of an SQL query, which UNIONS 2 log tables. This is done using an attachment text file. My issue is that management wants the results in the body of the email. As of now, this is a 2-3 step process to open the email and attachment. They just want to open the email and see the query results in the email body. I can't say that I blame them. LOL!
Does anyone know of a better way to handle this? Please see my list below and as always thank you all in advance!
Any assistance would be greatly appreciated!
Dave
The are no problems, only solutions. --John Lennon
December 31, 2024 at 4:06 pm
Thanks Ken - Thank you very much for your response, but this is just creating an XML table. I need to embed a SQL query into the body of an MS Outlook email.
The are no problems, only solutions. --John Lennon
December 31, 2024 at 4:19 pm
¿Qué?
Just send an html email with the table in the body text.
December 31, 2024 at 9:24 pm
Several examples here: https://www.sqlservercentral.com/forums/topic/create-html-email
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
January 9, 2025 at 2:52 pm
Hi SSC team,
I wanted to leave the answer here just in case anyone else needs it. This works. Only caveat is that you need to use dts.vaiables instead of what they are using depending on your VS version.
Thank you all for your help!!!
Happy New Year!
The are no problems, only solutions. --John Lennon
January 9, 2025 at 4:20 pm
Hi SSC team,
I wanted to leave the answer here just in case anyone else needs it. This works. Only caveat is that you need to use dts.vaiables instead of what they are using depending on your VS version.
Thank you all for your help!!!
Happy New Year!
Are you happy with doing such a thing through SSIS? You can, instead, build the body of the email as HTML in a string variable (NVARCHAR(MAX)) and then just send the email using that variable as the body.
The reason why I do it that way is because <<insert drum-roll here>>, I have a mostly hate-relationship with SSIS.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2025 at 12:15 am
.
January 10, 2025 at 12:15 am
Lord Slaagh wrote:Hi SSC team,
I wanted to leave the answer here just in case anyone else needs it. This works. Only caveat is that you need to use dts.vaiables instead of what they are using depending on your VS version.
Thank you all for your help!!!
Happy New Year!
Are you happy with doing such a thing through SSIS? You can, instead, build the body of the email as HTML in a string variable (NVARCHAR(MAX)) and then just send the email using that variable as the body.
The reason why I do it that way is because <<insert drum-roll here>>, I have a mostly hate-relationship with SSIS.
Do you use a cursor to create the body? 😁
January 10, 2025 at 2:34 am
Jeff Moden wrote:Lord Slaagh wrote:Hi SSC team,
I wanted to leave the answer here just in case anyone else needs it. This works. Only caveat is that you need to use dts.vaiables instead of what they are using depending on your VS version.
Thank you all for your help!!!
Happy New Year!
Are you happy with doing such a thing through SSIS? You can, instead, build the body of the email as HTML in a string variable (NVARCHAR(MAX)) and then just send the email using that variable as the body.
The reason why I do it that way is because <<insert drum-roll here>>, I have a mostly hate-relationship with SSIS.
Do you use a cursor to create the body? 😁
You already know the answer to that... 😉 Not only "NO" but "HELL NO!!!" 😀
For my "Morning Reports", I have the servers send me an email using the technique explained in the following MS Documentation...
I also do some little tricks with the conditional coloring of cell backgrounds to highlight issues, etc.
I should check if others have written much about the method and, if not, maybe write an article that explains how I do a "Morning Jobs Report".
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2025 at 9:06 pm
Hi Jeff,
I am not a huge fan of SSIS myself, but it pays the bills. I will look into the HTML solution, but that would require another step in this process... I think.
Thank you again. Nice to meet you!
Dave
The are no problems, only solutions. --John Lennon
January 10, 2025 at 9:11 pm
Jonathan AC Roberts wrote:Jeff Moden wrote:Lord Slaagh wrote:Hi SSC team,
I wanted to leave the answer here just in case anyone else needs it. This works. Only caveat is that you need to use dts.vaiables instead of what they are using depending on your VS version.
Thank you all for your help!!!
Happy New Year!
Are you happy with doing such a thing through SSIS? You can, instead, build the body of the email as HTML in a string variable (NVARCHAR(MAX)) and then just send the email using that variable as the body.
The reason why I do it that way is because <<insert drum-roll here>>, I have a mostly hate-relationship with SSIS.
Do you use a cursor to create the body? 😁
You already know the answer to that... 😉 Not only "NO" but "HELL NO!!!" 😀
For my "Morning Reports", I have the servers send me an email using the technique explained in the following MS Documentation...
I also do some little tricks with the conditional coloring of cell backgrounds to highlight issues, etc.
I should check if others have written much about the method and, if not, maybe write an article that explains how I do a "Morning Jobs Report".
That sounds like an interesting article!
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply