Search of table names

I use the following to search for strings in my stored procedures:

use DBname
SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%xxx%'

Is it easy to amend the above so that it searches Table names in a specific db “DBname” ?


Answer

I’m using this and works fine

SELECT * FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_NAME LIKE '%%'

Leave a Reply

Your email address will not be published. Required fields are marked *