Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Display email cast table results

$
0
0

Hi, 

I am creating SP to send email and have email body:

SET @body =CAST(( 
SELECT Time AS 'td','',
User AS 'td','',
Address 'td','',
Telephone AS 'td'
FROMTemporary.#Table AS tb
ORDER BY tb.Time
FOR XML PATH('tr'), ELEMENTS 
) AS NVARCHAR(MAX));

I need to display results before sending email. I know SQL does not support HTML tags but could I get results with tags printed out, I will paste code to test.html and will get required results? Have tried PRINT @body, but it does not works, also SELECT @body does not works, what I missed? 

thank you



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>