I am trying to return a taskid from the following
declare @xmltask xml
set @xmltask = '<tasks xmlns="http://iTask/task.xsd">
<task>
<taskid>371</taskid>
</task>
<tasks>'
select task.ref.value('(taskid/text())[1]','nvarchar(50)') as taskid
from @xmlTask.nodes('/tasks/task') task(ref)
it returns 371 only if I remove the namespace. how can I make if work it with the namespace