Reputation: 2319
Is it possible to filter e.g. tables in Object Explorer in SSMS based on a or
condition. That is I want to filter all tables which either have "this" or "that" (see below)
Upvotes: 4
Views: 2965
Reputation: 6111
You can only do this using queries.
Examples
USE [YourDatabase]
-- Get all tables starting with a or b, inside schema dbo.
SELECT *
FROM sys.tables t
WHERE (t.Name LIKE 'A%'
OR t.Name LIKE 'B%')
AND t.schema_Id = schema_id('dbo')
-- Get all Tables, views, Stored procedures, and inline table valued functions starting with A
SELECT *
FROM sys.objects o
WHERE o.Name LIKE 'A%'
AND o.type IN (
'U' -- User table
, 'V' -- Vieww
, 'P ' -- Stored Procedure
, 'IF' -- Inline Table valued Functions
)
Upvotes: 1