Select Query is not working with WHERE clause when there is a space in column value. since my table column value has space in it. When I copied same value from query result and put that with where clause, it doesn’t return any result. .
select * from myTable
if I run below query
select * From myTable where OldLoanNumber ='000000010383904 '
, it doesn’t return any result
SQL Server Version is 18.6 as shown in pic
Am I missing anything or any settings related to SQL Query Analyzer?
Advertisement
Answer
The ANSI standard says that string comparisons are to be padded to the same length, and I have observed that behavior many times.
I believe the most likely cause of your problem is the last character being a tab or other non space character that simply looks like a space to you.