Find tables with names with specific prefix

Query below finds tables which names start with specific prefix, e.g. tables with names starting with 'C' in the 'Sales' database.


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


  • DatabaseName - name of database (redundant as it should be exactly the same as provided)
  • TableName - name of found table


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

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.