I know that sp_msforeachtable allows to perform queries on all tables.
sp_msforeachtable
I have 100 tables and I want to perform the same query on 97 tables.
I\'
Simplest syntax I came across to include or exclude schemas and tables:
exec sp_MSforeachtable 'print ''?''', @whereand='and Schema_Id=Schema_id(''Value'') and o.Name like ''%Value%'''