July 7, 2010 at 2:23 am
July 7, 2010 at 3:20 am
select r.query('.')
from @xml.nodes('/U/N[@id="2" and @ type ="good"]') as x(r)
____________________________________________________
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/61537July 7, 2010 at 4:23 am
If the search criteria is dynamic (usnig a variable) see this blog post
N 56°04'39.16"
E 12°55'05.25"
July 7, 2010 at 5:41 am
I have a very similar solution to Mark's.
select
row.value('@id', 'varchar(100)') as id,
row.value('@type', 'varchar(100)') as type,
row.query('.')
from @xml.nodes('/U/N') as xmltable(row)
where
row.value('@type', 'varchar(100)') = 'good'
I hope that helps,
July 7, 2010 at 3:20 pm
I'm not sure whether it's a good idea or not to ask a question using the "sliced salami approach"...
Here's the related link with the other two questions regarding the very same subject.
As you probably noticed by now each "slice" might result in a different approach. Wouldn't it be easier to describe the whole picture all at once?
It would also help us that volunteer answering questions since we won't have to go back and forth with every new information...
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply