I use the following to search for strings within the stored procedures of a specific database:
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" ?
SQL Server Management Studio Object Explorer browse to the database you want to search through. write the name (full or partial) of the database object in the Search text box. press Enter to start the search process.
The syntax to get all table names with the help of SELECT statement. mysql> use test; Database changed mysql> SELECT Table_name as TablesName from information_schema.
I'm using this and works fine
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%%'
select name from DBname.sys.tables where name like '%xxx%' and is_ms_shipped = 0; -- << comment out if you really want to see them
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With