I have a table called TableName
with a column Characters
.
In the Characters
column I have the following data with some others that need to be checked as well as these:
Apples
15
chocolate
afternoon
Joe & taffy
@fternoon
^up
(here)
`til
I want to have a SQL script that would allow me to find any characters in that column that would be invalid for XML
or SQL
. Sort of like a patindex
.
So I would like this to show something like this:
Joe & Taffy, line number 5, 4th character
@fternoon, line number 6, 1st character
D'antonio, line number 452, 2nd character
Ch@rles', line number 947, 3rd character and 8th character.