How to find fields containing the TAB character in SQL Server

How to find fields containing the TAB character in SQL Server

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!

How to find fields containing the TAB character in SQL Server

Leave a Reply

Your email address will not be published.