Find tables with digits in names

Query below finds all tables with digits in their names.

Query

SELECT  DatabaseName,
        TableName
FROM    DBC.TablesV
WHERE   TableKind = 'T'
AND     REGEXP_SIMILAR(TableName,'.*[0-9].*') = 1
ORDER BY    DatabaseName,
            TableName;

Columns

  • DatabaseName - name of database where table was found in
  • TableName - name of table

Rows

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

Sample results

List of tables with digits in their names.