November 23, 2009 at 9:09 am
Hello All,
I have a DTS package which exports the result set to an excel sheet and email it to the users using SMTP Mail task. I'm wondering if I can achieve this by sending the result set in email message body instead of a spreadsheet. Please advise.
Thanks,
-Amith Vemuganti
November 25, 2009 at 6:51 am
not exactly what you're looking for, but my favorite way to email result sets is via Reporting Services subscriptions. very easy to read on mobile phones as well
November 25, 2009 at 7:20 am
I'm actually looking for my DTS package being able to send the result set, pulled by a SELECT statement inside the ExecuteSQL package, in an email with SMTP mail task to the users. I'd appreciate if some one could give me a solution or an idea on how I can do it.
Thanks,
-Amith Vemuganti
November 25, 2009 at 7:42 am
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'ProfName',
@recipients = '',
@query = 'SELECT 1,1,1,1,1',---specify your select query here
@subject = 'SUB',
@attach_query_result_as_file = 0 ;
The result of query will go in the body of the mail.
-Vikas Bindra
November 25, 2009 at 7:57 am
vikas bindra (11/25/2009)
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'ProfName',
@recipients = '',
@query = 'SELECT 1,1,1,1,1',---specify your select query here
@subject = 'SUB',
@attach_query_result_as_file = 0 ;
The result of query will go in the body of the mail.
Where is the Excel file being created here? The OP wanted an excel file to have the results and send that excel in email.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
November 25, 2009 at 8:01 am
Bru Medishetty (11/25/2009)
vikas bindra (11/25/2009)
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'ProfName',
@recipients = '',
@query = 'SELECT 1,1,1,1,1',---specify your select query here
@subject = 'SUB',
@attach_query_result_as_file = 0 ;
The result of query will go in the body of the mail.
Where is the Excel file being created here? The OP wanted an excel file to have the results and send that excel in email.
I think he doesn't want the spread sheet. check his first post.
Hello All,
I have a DTS package which exports the result set to an excel sheet and email it to the users using SMTP Mail task. I'm wondering if I can achieve this by sending the result set in email message body instead of a spreadsheet. Please advise.
Thanks,
-Amith Vemuganti
Either of us got it wrong:-)
-Vikas Bindra
November 25, 2009 at 8:03 am
I am confused now...:-)
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
November 25, 2009 at 8:07 am
Lets wait for his reply.:Whistling:
-Vikas Bindra
November 25, 2009 at 9:06 am
Vikas/Bru, Thanks for responding!
Yes. I don't want the result set in spread sheet or any other file. I want the result set to be sent in email message body. Unfortunately, I don't see sp_send_dbmail and xp_sendmail extended stored procedures in my msdb or master databases.
Thanks,
-Amith Vemuganti
November 26, 2009 at 12:19 am
sp_send_dbmail must be present in MSDB under system Stored procedures.
To use this procedure to send mails first you need to configure Database Mail under the Management tab in SSMS.
-Vikas Bindra
November 26, 2009 at 6:16 am
Not sure, whether the OP was using SQL 2000 or 2005 ?
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
November 26, 2009 at 6:22 am
Bru Medishetty (11/26/2009)
Not sure, whether the OP was using SQL 2000 or 2005 ?
Yes..He has not mentioned...
My reply stands for 2005 and 2008;-)
Hey Bru, I checked you site...you have small but really good blogs...
-Vikas Bindra
November 26, 2009 at 6:25 am
Thanks,
You can suggest something..
I am planning to introduce few more sections adding a section each month.
Coming backto this thread, the OP posted the thread in DTS, hence expecting it to be 2000.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
November 26, 2009 at 6:30 am
Oops...my bad...I didn't notice that...I also now think it is 2000..
You can write a blog on configuring DBMail 🙂 Again a small but helpful article.
-Vikas Bindra
November 26, 2009 at 6:35 am
Would be glad, I shall let you know when I post it.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply