question

gotqn avatar image
gotqn asked

Technique for fixing XML parsing: illegal qualified name character

Is there a ultimate solution for fixing the following error: > Msg 9455, Level 16, State 1, Line 8 > XML parsing: line 1, character 12, illegal qualified name character which is raised when converting "illegal" `NVARCHAR` string to `XML`. For example: DECLARE @Text NVARCHAR(MAX) SET @Text = '' + 'Test
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Tom Staab avatar image
Tom Staab answered
I believe this method will do what you want: DECLARE @Text nvarchar(max) = 'Test >&&
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

gotqn avatar image gotqn commented ·
The result should be XML type ready for working with XML functions like nodes/value/query
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.