我有一个这样的查询:
SELECT
getdate()[createdon], 'www.google.com'[XMLNS],
Co.Country, IC.InterConnectionName as point,
SO.SOName[TSO], FD.GasDay, FD.CaptureDate,
CD.mwhentry AS entrymwh, CD.mwhexit AS exitmwh,
DS.State, (CD.MWHENTRY - CD.MWHEXIT) AS NETMWH,
(cd.mwhexit - cd.mwhexit) as NETMCH
FROM
TABLENAME
我希望将其转换为 xml
<gas-flow created-on="2012/06/02T10:30:01Z"
xmlns="www.google.com">
<country>Austria</country>
<point>TSO4</point>
<tso>BOG</tso>
<gas-day>2012/06/02</gas-day>
<capture-date>2012/06/02T10:30:00Z</capture-date>
<state version="1">provisional</state>
<entry mwh="558234" mcm="52.80"/>
<exit mwh="0" mcm="0"/>
<net mwh="558234" mcm="52.80"/>
</gas-flow>
如果我这样做
FOR XML RAW ('gasflow'), ROOT ('FLOWDATAID'), ELEMENTS
我也得到标签之间的数据,但问题是
entry tag, exit tag and net mwh
必须是这样的
谢谢您的帮助..