For this xml (in a SQL 2005 XML column):
1
this:
declare @xml as xml set @xml = ' 1 ' select @xml.query(' for $attr in /doc/b/@* return local-name($attr)')
returns:
ba bb bc