List all tables with a certain string

  • Your problem here is that the underscore character is itself a wildcard in T-SQL, matching any single character. That explains the results you are seeing.

    The solution is to ESCAPE the wildcard. Something (rather inelegant) like this (untested):

    Select name 
    from sys.tables
    where name like '%|_ar|_%' ESCAPE '|';

    • This reply was modified 4 years, 10 months ago by Phil Parkin.

  • Thanks Phil it seems to work !

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply