Varchar SQL variable insert question mark

I have a database value that, when inserted into a SQL variable, shows with a question mark at the end! can't find the reason ?!

declare @A varchar(50) = 'R2300529‏'  
select @A

      

Results: R2300529?

any explanation? I am using SQL server 2012

.

+3


source to share


3 answers


There is an unrecognizable character in your string:

enter image description here



what gives ?

. Delete the value and repeat, see my screenshot above.

+7


source


It's actually a right-to-left character at the end of a line. Inspect this page with developer tools and look at your line, you can see this.



+4


source


I am assuming you copied / pasted this value from somewhere. Either that or you are doing a brain teaser here. But copying / pasting the exact script you provided shows an extra character: 0x3F which is ?

Hex-ASCII based conversion.

I would recommend just retyping your script and not copy / paste.

+3


source







All Articles