2016-02-09 115 views

回答

0

您可以嘗試使用此塊的SQLServer數據庫:

declare @table1 varchar(max) 
set @table1 = cast (
(
select 2 [@cellpadding], 
     0 [@cellspacing], 
     1 [@border], 
(
select (select convert(varchar, COL-1) for xml path('td'),type), 
     (select convert(varchar, COL-2) for xml path('td'),type), 
     (select convert(varchar, COL-3) for xml path('td'),type), 
     (select convert(varchar, COL-4) for xml path('td'),type), 
     (select convert(varchar, COL-5) for xml path('td'),type), 
     (select convert(varchar, COL-6) for xml path('td'),type) 
    from #updates 
for xml path ('tr'),type 
) 
for xml path('table'), type 
) 
as varchar(max)) 

set @EmailRecipient = 'E-Mail Addresses' 
set @MessageSubject = 'Subject' 
set @MessageBody = 
'<strong>'[email protected]+'</strong><br><br>'+ 
@table1; 

EXEC msdb..sp_send_dbmail @profile_name='Any Short Msg', 
    @recipients = @EmailRecipient, 
    @subject = @MessageSubject, 
    @body = @MessageBody, 
    @body_format = 'HTML'; 

下面是谷歌的一些鏈接,可以幫助你在這。

https://www-304.ibm.com/connections/forums/html/topic?id=d2b1272b-9690-4b0b-ae0c-9e81bf4be444

https://www.talendforge.org/forum/viewtopic.php?id=27346

http://www.sqlteam.com/article/sending-smtp-mail-using-a-stored-procedure

http://www.serkey.com/tag/sendmail-cfg-netezza/

+0

當我試圖從Netezza公司DB發送郵件,你可以分享在Netezza – jaga

+0

的第一個博客的任何想法,我已經訪問過這涉及一些UDF函數,我無法找到很多信息。由於它是UDF函數,我不確定它是否具有netezza DB的內置功能。下一篇博客討論如何在excel中編寫列表併發送我們已經通過shell命令嘗試執行的命令。 – jaga

+0

鏈接的其餘部分我找不到多大幫助。請告訴我是否有其他可能性,或者是否可以讓我知道有關此UDF函數的一些信息_cf_utl_exec – jaga

相關問題