Matt Ruwe
Matt Ruwe

Reputation: 3406

Hide/Filter tables in SQL Server Management Studio

I have a SQL database that has several hundred tables in it, but I only need to work with a few. Is there a way to hide most of the tables from view within SQL Server Management Studio 2008? Another option would be to create some sort of grouping that would only reference the tables I'm interested in. Filtering the tables works, but I'm not able add an OR logical operator to include multiple criteria.

Thanks, Matt

Upvotes: 1

Views: 9257

Answers (3)

Mark
Mark

Reputation: 9428

One way to get tables out of the way in management studio is to mark them with the microsoft_database_tools_support property. This will cause management studio to list those tables under the "System Tables" subfolder. Note that leaving user tables visible to users is usually better practise.

My script template to hide/unhide a table in SSMS:
(Cut'n'paste into query editor, then CTRL+SHIFT+M)

EXEC sp_addextendedproperty 
@name = N'microsoft_database_tools_support', 
@value = <Hide? , int, 1>, 
@level0type = 'schema', 
@level0name = N'<Schema Name, sysname, dbo>',
@level1type = 'table', 
@level1name = N'<Table Name, sysname, ?>'

Upvotes: 5

smdrager
smdrager

Reputation: 7417

I realize this is an old question, however in SQL Server Managaement Studio 2008, you can filter by name, schema, owner, or creation date by right clicking on tables, views, stored procedures object "folders" and clicking Filter > Filter Settings

Upvotes: 4

Bravax
Bravax

Reputation: 10493

One way would be to create a user which only has access the tables you're interested in.
Then connect as that.

Upvotes: 4

Related Questions