输入:
Declare @OUT xml
select @OUT = N'
<row>
<kind>MainCat</kind>
<sortid>1</sortid>
<kind_id>1</kind_id>
<PPoet>حافظ</PPoet>
<MTitle>حافظ</MTitle>
<Row>1</Row>
</row>'
select T.X.value('@Kind', 'nvarchar(50)') as kind,
T.X.value('@sortid', 'int') as sortid
from @out.nodes('/row') as T(X)
this select return NULL!
很接近: