Also this
SELECT child.value('(parent::node()/ID/text())[1]', 'NVARCHAR(50)') AS [ID]
, child.value('(State/text())[1]', 'NVARCHAR(50)') AS [State]
, child.value('(Value/text())[1]', 'NVARCHAR(50)') AS [Value]
FROM [XmlTable] AS T
CROSS APPLY [ImportData].nodes('/Parent/Child[State/text() != "1"]') AS ImportData(child)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537