I'm having an small issue with SQLXML in SQL Server 2008. Here's my testing SQL query
DECLARE @XMLTable TABLE(GameHistory XML)
INSERT INTO @XMLTable VALUES( '<game xmlns="http://my.name.space">
<move>
<player>white</player>
<piece>pawn</piece>
<start>A2</start>
<end>A3</end>
</move>
<move>
<player>black</player>
<piece>pawn</piece>
<start>D7</start>
<end>D6</end>
</move>
</game>')
SELECT GameHistory.query('/game/move[1]') FROM @XMLTable
Now if I take out the namespace (xmlns="http://my.name.space") part my query works fine. Why does removing the namespace fix the issue?