I\'ve tried every avenue on every damn forum suggested, but to no avail!
Need to send results of SQLPERF(logspace), that have been stored in a table, via sp_send_dbmai
I know this thread is a bit old, but in case someone stumbles on this, the problem is like mrdenny said that sp_send_dbmail stored procedure runs in it's own session, however you can get around this by using a global temporary table instead (prefix the table with two pound signs (##)).