改变 sql xml auto 的视图/样式

发布于 2024-11-09 05:36:03 字数 1360 浏览 4 评论 0原文

我有下面的代码(接着我之前的问题 SQL How to list Columns in a Table as a Cursor Statement)

select 
    (select * from
        (select Narrative 
         from OfficeClientLedger
         where ptMatter=$Matter$ and ptTrans = 4) 
     as Disbursments for xml auto)

它返回

<OFFICECLIENTLEDGER NARRATIVE="M0604/20 Cwm Taff NHS Trust Medical Records (C)"/><OFFICECLIENTLEDGER NARRATIVE="M0604/210 Dr Purby Medeical Records (C)"/><OFFICECLIENTLEDGER NARRATIVE="M0604.20 Orchid Cellmark tld Fee"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Parsons Dowd Psychological Ltd Assessment Fees"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Dr R  Oretti Drug testing"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Correction of MIssposting CQ 013524"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Helen Blackler Assessment Fees (P) "/> 

但是,我需要它给我带来一个列表,例如

M0604/20 Cwm Taff NHS 信托医疗 记录(C)

M0604/210 Purby 博士医疗记录 (三)

M0604.20 Orchid Cellmark tld 费用

M0604/20 帕森斯多德

M0604/20 Dr R Oretti 药物测试

M0604/20 错误发布 CQ 的更正 013524

M0604/20 海伦·布莱克勒评估 费用(P)

有什么想法吗?谢谢

i have the below peice of code (following on for my earlier question SQL How to list Columns in a Table as a Cursor Statement)

select 
    (select * from
        (select Narrative 
         from OfficeClientLedger
         where ptMatter=$Matter$ and ptTrans = 4) 
     as Disbursments for xml auto)

Which returns

<OFFICECLIENTLEDGER NARRATIVE="M0604/20 Cwm Taff NHS Trust Medical Records (C)"/><OFFICECLIENTLEDGER NARRATIVE="M0604/210 Dr Purby Medeical Records (C)"/><OFFICECLIENTLEDGER NARRATIVE="M0604.20 Orchid Cellmark tld Fee"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Parsons Dowd Psychological Ltd Assessment Fees"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Dr R  Oretti Drug testing"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Correction of MIssposting CQ 013524"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Helen Blackler Assessment Fees (P) "/> 

However, I need it to bring me a list such as

M0604/20 Cwm Taff NHS Trust Medical
Records (C)

M0604/210 Dr Purby Medeical Records
(C)

M0604.20 Orchid Cellmark tld Fee

M0604/20 Parsons Dowd

M0604/20 Dr R Oretti Drug testing

M0604/20 Correction of MIssposting CQ
013524

M0604/20 Helen Blackler Assessment
Fees (P)

any ideas? thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

从来不烧饼 2024-11-16 05:36:03
select
(select cast(Narrative as varchar(max))
from OfficeClientLedger
where ptMatter=$Matter$ and ptTrans = 4
as Disbursments for xml path(''), true)
select
(select cast(Narrative as varchar(max))
from OfficeClientLedger
where ptMatter=$Matter$ and ptTrans = 4
as Disbursments for xml path(''), true)
小傻瓜 2024-11-16 05:36:03

您可以使用 XSL 样式表来更改从 SQL Server 检索到的 XML 的格式。

http://sqlxml.org/faqs.aspx?faq=99

You could use an XSL style sheet to change the format of the XML retrieved from SQL Server.

http://sqlxml.org/faqs.aspx?faq=99

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文