I have the sp, with the below script within it. when fileexists, sometimes the filesize is toomuch due to that the job failing. to email. saying file size exceeded.is it possible to check the filesize: EXEC Master.dbo.xp_fileexist @filepath,@File_Exists OUT IF @File_Exists = 1 BEGIN DELETE Tab_EmailDistribution WHERE emailid=@emailid EXEC msdb.dbo.sp_send_dbmail @profile_name = 'fROM_DB_Mail1', @recipients=@recipient, @copy_recipients = @copymailto, @body = @mailbody, @subject=@Subject, @file_attachments=@filepath END
Thanks a lot for the helpful info.