Steve A
asked on
Sql Server - XQuery [value()]: No more tokens expected at the end of the XQuery expression
Msg 2370, Level 16, State 1, Line 30
XQuery [value()]: No more tokens expected at the end of the XQuery expression. Found '1'.
Getting this error above when I do this select statement below. Is there a better way to fix this XML PATH statement?
Thanks.
(Using Sql Server 2016)
select 7271 container_id into #cr_containers
(SELECT
Stuff((
SELECT N',' + cast(container_id as nvarchar(50))
from #cr_containers
FOR XML PATH(''),TYPE
).value('text()1','nvarcha r(max)'),1 ,1,N''));
XQuery [value()]: No more tokens expected at the end of the XQuery expression. Found '1'.
Getting this error above when I do this select statement below. Is there a better way to fix this XML PATH statement?
Thanks.
(Using Sql Server 2016)
select 7271 container_id into #cr_containers
(SELECT
Stuff((
SELECT N',' + cast(container_id as nvarchar(50))
from #cr_containers
FOR XML PATH(''),TYPE
).value('text()1','nvarcha
ASKER
(SELECT
Stuff((
SELECT N',' + cast(container_id as nvarchar(50))
from #cr_containers
FOR XML PATH(''),TYPE
).value('text()[1]','nvarc har(max)') ,1,1,N'')) ;
Stuff((
SELECT N',' + cast(container_id as nvarchar(50))
from #cr_containers
FOR XML PATH(''),TYPE
).value('text()[1]','nvarc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, will try it this way instead of my "band-aid".
Thanks again.
Thanks again.
ASKER
(SELECT
Stuff((
SELECT N',' + cast(container_id as nvarchar(50))
from #cr_containers
FOR XML PATH(''),TYPE
).value('text()1','nvarcha
Works fine now.
Thanks