从SQL中的一个表中导出HTML文件表格

EXECUTE sp_makewebtask @outputfile = 'D:\alcatel\20030902\check.htm',

@query = 'SELECT * FROM Eiems_temporarydata..property', @templatefile = 'D:\alcatel\20030902\check.TPL',------check.tpl 文件为模板文件

@dbname = 'Eiems_temporarydata', @rowcnt = 0, @whentype = 9 ,@lastupdated = 1

GO

check.TPL*

 1<html>
 2<head>
 3<title>pelease check it when you finish!</title>
 4<style type="text/css">
 5
 6body{font-size:9pt} 
 7
 8TH{FONT-SIZE: 12pt} 
 9
10TD{ font-size: 12pt } 
11
12\-->
13
14</style>
15<body bgcolor="#FFF5EE" text="#ffffff">
16<center>
17<h1><font color="000000">check it!</font></h1>
18<hr/>
19<p>
20<h2>
21<table bgcolor="#436EEE" border="1" cellpadding="0" cellspacing="0">
22<tr> <th><b>Size</b></th>
23<th><b>Date</b></th>
24<th><b>Name</b></th>
25<th><b>Exist</b></th>
26<th><b>Remark</b></th>
27<th><b>result</b></th>
28</tr>   

begindetail

 1<tr> <td> ```
 2insert_data_here
 3``` </td>
 4<td align="RIGHT">```
 5insert_data_here
 6```</td>
 7<td align="RIGHT">```
 8insert_data_here
 9```</td>
10<td align="RIGHT">```
11insert_data_here
12```</td>
13<td align="RIGHT">```
14insert_data_here
15```</td>
16<td align="RIGHT">```
17insert_data_here
18```</td>
19</tr>   

enddetail

1</table>
2</h2></p></center>
3
4</body>
5</head></html>
Published At
Categories with 数据库类
Tagged with
comments powered by Disqus