question

tsaliki avatar image
tsaliki asked

help to Display the table in html format using sql server

i have a table like below: create table testjob (jobid int, jobname varchar(100), time float, name varchar(50) ) insert into testjob values ( 1001,'java work',4.5,'arjun') insert into testjob values ( 1005,'sql work',10,'arjun') insert into testjob values ( 1010,'.net work',7.5,'arjun') insert into testjob values ( 1040,'java work',5.5,'ravi') insert into testjob values ( 1023,'php work',2.5,'arjun') insert into testjob values ( 1027,'.net work',3.5,'ravi') i want a procedure so that my output is as below in the html format like below that is in sql we will write `select * from testjob` but i want the output to be displayed in html using stored procedure or so Name Jobname Time arjun Javawork 4.5 arjun sql work 10 arjun .net work 7.5 ravi java work 5.5 arjun php work 2.5 ravi .net work 3.5
sql-server-2005stored-procedureshtml
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
sp_lock avatar image
sp_lock answered
Hi, This [blog][1] should help you get the desired result. Personally I prefer the devs to handle the output. The only time I use this in when I create a email notification from a SQL agent jobs and I need to to look "pretty" with tables and rich text. [1]: http://jahaines.blogspot.co.uk/2010/04/t-sql-tuesday-005-creating-emailing.html
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.