In SQL Server, what is the best way to identify all rows in a table where a certain column contains the TAB
character (CHAR(9)
)
Is it as simple as
SELECT * FROM MyTable WHERE Field1 LIKE '%' + CHAR(9) + '%'
RTRIM
CHAR columns. like this:
SELECT *
FROM MyTable
WHERE (RTRIM(Field1) LIKE '%' + CHAR(9) + '%')
Previous query fails, with: "missing expression" message, In Oracle, this is the correct syntax
select *
from MyTable
where Field1 '%' || CHR(9) || '%';
Other solution can be:
Select *
from MyTable
where instr(Field1, CHR(9)) <> 0;
Cheers!