|
declare @applyno int
declare email cursor for
select applyno from lis_list
open email
fetch next from email into @applyno
while @@fetch_status=0
begin
exec lsp_GetResultData @applyno
EXEC master..xp_sendmail @recipients = "1395204****@139.com",@message = "检验结果:",
@query = "SELECT * FROM #email",
@subject = "化验结果",
@attach_results = "TRUE", @width = 250
fetch next from email into @applyno
end
close email
deallocate email
drop table #email
go
------------------------------#email是存储过程生成的临时表,不过还是报错,ODBC error 208 (42S02)
|