sp_send_dbmail will not send query results

前端 未结 3 766
挽巷
挽巷 2021-01-02 19:14

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

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 19:33

    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 (##)).

提交回复
热议问题