我在SQL Server中的XML存儲與結構如下選擇XML元素:與where子句的SQL Server
<ecHeaderData>
<FirstVersionSource>System1</FirstVersionSource>
<DMSEntryUserID>jsmith</DMSEntryUserID>
</ecHeaderData>
我想返回所有行DMSEntryUserID不是空白。我想在查詢中選擇FirstVersionSource和DMSEntryuserID。
事情是這樣的:
select deal_jacket_xml('/ecHeader/FirstVersionSource') as FirstVersionSource,
deal_jacket_xml('/ecHeader/DMSEntryUserID') as DMSEntryUserID
from deal_jacket_xml
where deal_jacket_xml('NotBlank(/ecHeader/DMSEntryUserID'))=1
order by [deal_jacket_xml_id] desc
你的問題沒有什麼意義。閱讀[xml數據類型方法](https://msdn.microsoft.com/en-us/library/ms190798.aspx)首先 –