Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select all tables with a particular name in database

Tags:

sql-server

How do I select all the tables name with a particular name in the database?

like image 460
user87810 Avatar asked Apr 10 '09 20:04

user87810


1 Answers

Either sysobjects (where type='u'), or (more correctly) the info-schemas:

SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE '%CUSTOMER%' -- or "='CUSTOMER'" for exact

If you meant something different, please clarify.

like image 111
Marc Gravell Avatar answered Oct 27 '22 20:10

Marc Gravell