January 19, 2010 at 12:41 pm
Hi,
how i can change the font and text size in the results of the select statement?
(simple script from BOL)
THX
DECLARE @tableHTML NVARCHAR(MAX) ;
SET @tableHTML =
N'<H1>Work Order Report</H1>' +
N'<table border="1">' +
N'<tr><th>Work Order ID</th><th>Product ID</th>' +
N'<th>Name</th><th>Order Qty</th><th>Due Date</th>' +
N'<th>Expected Revenue</th></tr>' +
CAST ( ( SELECT td = wo.WorkOrderID, '',
td = p.ProductID, '',
td = p.Name, '',
td = wo.OrderQty, '',
td = wo.DueDate, '',
td = (p.ListPrice - p.StandardCost) * wo.OrderQty
FROM AdventureWorks.Production.WorkOrder as wo
JOIN AdventureWorks.Production.Product AS p
ON wo.ProductID = p.ProductID
WHERE DueDate > '2004-04-30'
AND DATEDIFF(dd, '2004-04-30', DueDate) < 2
ORDER BY DueDate ASC,
(p.ListPrice - p.StandardCost) * wo.OrderQty DESC
FOR XML PATH('tr'), TYPE
) AS NVARCHAR(MAX) ) +
N'</table>' ;
EXEC msdb.dbo.sp_send_dbmail @recipients='danw@Adventure-Works.com',
@subject = 'Work Order List',
@body = @tableHTML,
@body_format = 'HTML' ;
January 19, 2010 at 9:20 pm
Did you try Tools -> Options -> Environment -> Fonts and Colors?
January 19, 2010 at 11:39 pm
I doubt if it's possible for result pan 🙁
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
January 20, 2010 at 7:26 pm
It's totally possible- I tested it successfully!
January 21, 2010 at 12:02 am
what i meant is the email that sent to me i want to change the font size and color.
THX
January 22, 2010 at 9:35 am
since you're building an HTML formatted email body, it would seem to me that you could embed your font/color tags in that...
January 23, 2010 at 12:41 am
can you show me little example that i can progress with it?
THX
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply