Quantcast
Channel: XQuery namespace problem
Viewing all articles
Browse latest Browse all 4

XQuery namespace problem

$
0
0

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

 


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images