Find tables with names with specific suffix

Query below finds tables which names end with specific sufix, e.g. tables with names ending with 'Tab'.

Query

SELECT  DatabaseName,
        TableName
FROM    DBC.TablesV
WHERE   TableKind = 'T'
AND     TableName LIKE '%Tab'
ORDER BY    TableName;

Columns

  • DatabaseName - name of database
  • TableName - name of found table

Rows

  • One row represents one table
  • Scope of rows: all found tables
  • Ordered by table name

Sample results