x
login about faq Site discussion (meta-askssc)

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 '12 at 04:39 AM in Default

tsaliki gravatar image

tsaliki
150 2 7 11

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

1 answer: sort voted first

Hi,

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 '12 at 07:18 AM

sp_lock gravatar image

sp_lock
8.1k 20 26 29

(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.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1835
x340
x5

asked: Oct 05 '12 at 04:39 AM

Seen: 325 times

Last Updated: Oct 05 '12 at 01:05 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.