sp_send_email发送存储的proc变量结果

时间:2015-04-07 18:28:35

标签: sql-server tsql

我得到了一些冗长的代码,它本质上构建了一个长字符串,并且负责通过t-sql email发送这个长字符串。代码超过1300行,他们不希望我重写代码。我能够说服他们让我把它变成我做过的存储过程,并且工作正常。

我的问题是,有没有办法捕捉"消息"选项卡结果并通过sp_send_email存储过程发送出去?

例如,如果消息标签显示:

DB Instance: SqlSvrName\Instance

Timestamp: Apr  7 2015  2:21PM

QATech: DomainName\Name


CLAIMS TASKS CLEAN UP

1.0 Delete Duplicated Tasks

Claims Tasks That Have Duplicates

1 Claims Have Duplicated Tasks



1.1 Duplicate Removal 1

0 Tasks Deleted

1.1 Duplicate Removal 1 Complete



1.2 Duplicate Removal 2

0 Tasks Deleted

1.2 Duplicate Removal 2 Complete



1.3 Duplicate Removal 3

0 Tasks Deleted

1.3 Duplicate Removal 3 Complete

1 个答案:

答案 0 :(得分:0)

设置存储过程以将@MR用作OUTPUT参数