Hi Everyone,
I have a table
The counter column just contains a numerical counter. The Images column contains a pipe delimited list of file names:
00001.TIF|00002.TIF|00003.TIF|00004.TIF
00005.TIF|00006.TIF
I am trying to spit the images row into individual rows. For example
Counter, ImageList
1, 00001.TIF
1, 00002.TIF
1, 00003.TIF
1, 00004.TIF
2, 00005.TIF
2, 00006.TIF
Someone helped me work up the following script to split this out... and it works great. But I have one row where the length of the images column is 7071 characters. When I run the following script:
I get an error:
Msg 9400, Level 16, State 1, Line 1
XML parsing: line 1, character 8000, unexpected end of input
Is there a way I can get through the 8000 character limit or is there maybe another way I can go to split these out?
Thanks!
I have a table
Code:
create table mytable (counter int, Images varchar(8000))
The counter column just contains a numerical counter. The Images column contains a pipe delimited list of file names:
00001.TIF|00002.TIF|00003.TIF|00004.TIF
00005.TIF|00006.TIF
I am trying to spit the images row into individual rows. For example
Counter, ImageList
1, 00001.TIF
1, 00002.TIF
1, 00003.TIF
1, 00004.TIF
2, 00005.TIF
2, 00006.TIF
Someone helped me work up the following script to split this out... and it works great. But I have one row where the length of the images column is 7071 characters. When I run the following script:
Code:
SELECT A.[counter],
Split.a.value('.', 'VARCHAR(max)') AS imageslist
FROM (SELECT [counter],
CAST ('<M>' + REPLACE([images], '|', '</M><M>') + '</M>' AS XML) AS images
FROM Mytable) AS A CROSS APPLY images.nodes ('/M') AS Split(a);
I get an error:
Msg 9400, Level 16, State 1, Line 1
XML parsing: line 1, character 8000, unexpected end of input
Is there a way I can get through the 8000 character limit or is there maybe another way I can go to split these out?
Thanks!