SendingQuerying Data on Mail:
mail automatically. You can
send mail data fetched from report.
this job. Now you don’t need to
customerid as Customer_ID,[name] as Name,
FROM [db_omx_customer].[dbo].[tblIP] group by customerid,name
order by
No_of_Login,name desc
were provide a profile name that you need to pass with msdb.dbo.sp_send_dbmail.
sample@sample.com',
'HTML',
Customer_ID,[name] as Name,
No_of_Login,MAX(date1) as Last_Login_Date
group by customerid,name
run above query result will be sent on sample@same.com
as attached text
schedule a job that will run at
procedure for easiness as
as Customer_ID,[name] as Name,
as No_of_Login,MAX(date1) as Last_Login_Date
[db_omx_customer].[dbo].[tblIP] group by customerid,name
No_of_Login,name desc'
,@attach_query_result_as_file = 1; -- result sent in attched
file.
file automatically will be send to mail provided by you
scheduled time.