<game xmlns="http://my.name.space" ></game>
This is my root element. I've written a stored procedure to insert elements into it. To sum up the stored procedure, here's the SQL
UPDATE ChessGame SET GameHistory.modify('insert <move><player>black</player><piece>pawn</piece><start>E7</start><end>E6</end></move> as last into (/game)[0]') WHERE Id = @GameId;
Now when MSSQL does the insert an empty namespace is also inserted so the result is this
<move xmlns="">
<player>black</player>
<piece>king</piece>
<start>E7</start>
<end>E6</end>
</move>
Now I've tried using both
WITH XMLNAMESPACES(DEFAULT 'http://my.name.space')
and
GameHistory.modify('declare default element namespace "http://my.name.space"; insert ...')
But I end up with prefixes everywhere and a namespace declaration for each element.
Problems arise in code libraries that lack logic to handle the prefixes MSSQL puts in. In the end I just want to insert a new element into my xml root and to leave the namespace blank (use the root default?). I'm all very new to this but as I understand it, if I have a namespace in my root element, shouldn't all childnodes have a default namespace of my root?