I would like select the value of Type where the xml below is in an xml typed column in a table in a SQL Server 2005 database.
<Something xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Id xmlns="http://something.com/">1921</Id>
<Date xmlns="http://something.com/">1901-01-01T00:00:00Z</Date>
<Schedule xmlns="http://something.com/">Region</Schedule>
<Filters xmlns="http://something.com/">
<Data>
<Id>99999</Id>
<Name>CS</Name>
<Type>SomeType</Type>
</Data>
</Filters>
</Something>
Try something like this:
Basically, your root element
<Something>isn’t part of any explicit XML namespace – but any of the elements under<Filters>are – so therefore, you need to qualify those with an appropriate XML namespace prefix to get at the data inside the XML element.