Thursday, 24 August 2017

procedure to get mail for html file

DECLARE @attach varchar(1000)
SET @attach = 'E:\MSSQL\Healthcheck\report\Disk_'+ CONVERT (varchar,CONVERT (date, SYSDATETIME()))+'.html'
SELECT @attach

EXECUTE msdb..sp_send_dbmail
    @profile_name='TA-DRR',
    @recipients = 'Mail@xyz.com ;'Mail@xyz.com' ,
    @subject = 'diskspace report',
    @body_format = 'html',
    @exclude_query_output = 1,
    @append_query_error = 1,
                @file_attachments=@attach

No comments:

Post a Comment

Featured post

duplicate db from standy to other server

 Duplicate Testuat   $ export ORACLE_SID=Testuat3 $ sqlplus '/as sysdba' Testuat3 SQL> alter system set cluster_database=FALSE sc...