XML 1TSQL代碼來同步兩個XML文檔
<Team>
<Players>
<Player id="1" timestamp="11/03/2012 08:10:12">30</Player>
<Player id="2" timestamp="11/02/2012 09:11:12">40</Player>
<Players>
</Team>
XML 2
<Team>
<Players>
<Player id="1" timestamp="11/02/2012 09:10:12">10</Player>
<Player id="2" timestamp="11/03/2012 10:11:12">20</Player>
<Player id="3" timestamp="11/03/2012 13:00:00">50</Player>
<Players>
</Team>
OUTPUT當我們合併基於時間戳元件上的上述兩個個XML:
<Team>
<Players>
<Player id="1" timestamp="11/02/2012 09:10:12">30</Player>
<Player id="2" timestamp="11/03/2012 10:11:12">20</Player>
<Player id="3" timestamp="11/03/2012 13:00:00">50</Player>
<Players>
</Team>
任何人都可以請幫我與T-SQL代碼來做到這一點在SQL Server 2005/2008
@marc_s - 看起來'id'的後面一個會覆蓋之前的一個。 –