使用SQLforXML创建HTML表
Problem | Onset | Status--------------------------------- Ulcer | 01/01/2008 | Active Edema | 02/02/2005 | Active
<tr> <th>Problem</th> <th>Onset</th> <th>Status</th></tr><tr> <td>Ulcer</td> <td>01/01/2008</td> <td>Active</td></tr><tr> <td>Edema</td> <td>02/02/2005</td> <td>Active</td></tr>
SELECT p.ProblemType AS "td" , p.Onset AS "td" , p.DiagnosisStatus AS "td"FROM tblProblemList p WHERE p.PatientUnitNumber = @PatientUnitNumberFOR XML PATH('tr')
<tr> <td>Ulcer2008-01-01Active</td></tr><tr> <td>Edema2005-02-02Active</td></tr>