March 31, 2008 at 12:50 am
Hi,
I need to use this script ,.. select * from master.dbo.sysdatabases->use SQL DatabaseMail to send it to
whomever they require.
Could you please let me know how to do that
I have created a job and it is running succcessfully, taht resuly i need to sent
using SQL Database mail
Please help me to do this
Smm
March 31, 2008 at 1:33 am
EXEC msdb.dbo.sp_send_dbmail @profile_name = 'MyProfile'
, @recipients = 'me@mydomain.com'
, @subject = 'subject text'
, @body = 'subject body'
, @query = 'select * from master.dbo.sysdatabases'
, @attach_query_result_as_file = 1
, @execute_query_database = 'master'
BTW, this is all in BOL.
April 1, 2008 at 4:53 am
Hi,
Thanks ,is it possible to get the result in Excel,I am getting the result in .text format
Please help me
April 1, 2008 at 4:58 am
shine.mm (4/1/2008)
Hi,Thanks ,is it possible to get the result in Excel,I am getting the result in .text format
Please help me
Have a look at using the @query_result_separator and using a comma seperator. Then you might be able to open it in Excel as a csv.
An alternative could be to use SSIS to output to a .csv file, which you then email.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply