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
more ▼

asked Oct 05, 2012 at 04:39 AM in Default

tsaliki gravatar image

150 9 10 12

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first


This blog 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.

more ▼

answered Oct 05, 2012 at 07:18 AM

sp_lock gravatar image

9.3k 25 28 31

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Oct 05, 2012 at 04:39 AM

Seen: 753 times

Last Updated: Oct 05, 2012 at 01:05 PM