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

Postgres commads

 [oracle@Tesdb ~]$ systemctl status postgresql-15 ● postgresql-15.service - PostgreSQL 15 database server    Loaded: loaded (/usr/lib/system...