Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.


Declare @OUT xml
select @OUT = N'

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!
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Very close:

  T.X.value('./kind[1]', 'nvarchar(50)') as kind,
  T.X.value('./sortid[1]', 'int') as sortid
from @out.nodes('/row') as T(X);
share|improve this answer
thanks you..... –  Masoud Afrashteh Dec 13 '12 at 17:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.