create table #DriveSpaceLeft (Drive varchar(10), [MB Free] bigint ) insert #DriveSpaceLeft (Drive, [MB Free]) EXEC master.dbo.xp_fixeddrives; create table DrivesWithIssue (Drive varchar(10), [MB Free] bigint ) insert into DrivesWithIssue select Drive, [MB Free] from #DriveSpaceLeft where [MB Free] < 1000 drop table #DriveSpaceLeft declare @cnt int select @cnt=COUNT(1) from DrivesWithIssue if (@cnt > 0) begin declare @strsubject varchar(100) select @strsubject='Check drive space on ' + @@SERVERNAME declare @tableHTML nvarchar(max); set @tableHTML = N'
Drive | ' + N'MB Free |
---|