views:

316

answers:

2

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

+2  A: 

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

Bravax
Hadn't considered that, nice thought. However, I'd prefer to have a more UI based solution.
Matt Ruwe
I guess this is the best we can do?
Matt Ruwe
A: 

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? , sysname, 1>', 
@level0type ='schema', 
@level0name ='<Schema Name, sysname, dbo>',
@level1type = 'table', 
@level1name = N'.<Table Name, sysname, ?>'
Mark

related questions