如何使用T-SQL发送电子邮件,但电子邮件地址存储在表中?我想遍历表格并能够发送电子邮件.到目前为止,我找不到这样做的好例子.
谢谢你的帮助
我正在使用SQL Server 2008 R2中的FOR XML语句创建HL7 Continuity of Care Document(CCD).
我用这种方法做了很多,但这是我第一次在HTML表格中表示部分数据,这给我带来了麻烦.
所以,我在表格中有以下信息:
Problem | Onset | Status
---------------------------------
Ulcer | 01/01/2008 | Active
Edema | 02/02/2005 | Active
Run Code Online (Sandbox Code Playgroud)
我试图渲染以下内容
<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>
Run Code Online (Sandbox Code Playgroud)
我正在使用此查询:
SELECT p.ProblemType AS "td"
, p.Onset AS "td"
, p.DiagnosisStatus AS "td"
FROM tblProblemList p
WHERE p.PatientUnitNumber = @PatientUnitNumber
FOR XML PATH('tr')
Run Code Online (Sandbox Code Playgroud)
我一直得到以下内容:
<tr>
<td>Ulcer2008-01-01Active</td>
</tr>
<tr>
<td>Edema2005-02-02Active</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
有人有任何建议吗?
我想select Column from Table使用SQL Server 将结果返回到逗号分隔的字符串中.
有问题的列相当大(nvarchar(2000)),因此解决方案必须能够处理非常大的结果值.