Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Transform SQL result to HTML (table) code

Author  Topic 

ranalk
Starting Member

49 Posts

Posted - 2010-02-28 : 09:15:48
Hi All,

I asked for help before on this issue what haven't received any proper answer.
I would to transform the following table (#temp) to an Html code, that would show the same results in Table.


Thanks in advance!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-28 : 09:17:26
why you want to convert to html?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

ranalk
Starting Member

49 Posts

Posted - 2010-02-28 : 09:19:21
I need it to be sent by mail on daily basis
Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2010-02-28 : 09:25:24
select data from (
select 1 as myid, '<table border=1><tr><th>Subject</th><th>API_LIVE</th><th>LIVE</TH>' as data
union all
select
2 as myid,
'<tr><td>' + coalesce(subject, '') + '</td><td>' +
coalesce(convert(varchar(10), api_live), '') + '</td><td>' +
coalesce(convert(varchar(10), live), '') + '</td></tr>' from #temp
union all
select 3 as myid, '</table>' as data
) a order by myid


"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

ranalk
Starting Member

49 Posts

Posted - 2010-02-28 : 10:17:45
10x a lot !
Go to Top of Page
   

- Advertisement -