3342
abc
5342
xyz | Dig_Isprim | Code | Name | |-------------|--------|--------| | True | 3342 | abc | |-------------|--------|--------| | False | 5342 | xyz |
3342
abc
5342
xyz | Dig_Isprim | Code | Name | |-------------|--------|--------| | True | 3342 | abc | |-------------|--------|--------| | False | 5342 | xyz |
3342
abc
5342
xyz '; select x.value('@IsPrim[1]', 'varchar(5)') Dig_IsPrim, x.value('Code[1]', 'int') Code, x.value('Name[1]', 'varchar(10)') [Name] from @x.nodes('Dig') r(x); Based on the XML in question, this query produces the following result: Dig_IsPrim Code Name ---------- ----------- ---------- True 3342 abc False 5342 xyz Hope this helps. Oleg
18 People are following this question.