Thursday, December 13, 2018

Finding the table name in all the databases

EXEC
sys.sp_msforeachdb
'SELECT ''?'' DatabaseName, Name FROM [?].sys.Tables WHERE Name LIKE ''%student%'''

Replace Student in above query with the search table name .