Solved

SQL Server Management Studio Multiple Filters in Object Explorer?

Posted on 2014-09-14
18
1,293 Views
Last Modified: 2014-09-26
Is there really no add in or functionality that will allow you to have multiple filters in Management Studio Object Explorer? Mainly tables. I want to see all tables that begin with or contain XXX and all that have YYY.

Is it really hard?
0
Comment
Question by:mike1142
  • 7
  • 5
  • 3
18 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
Comment Utility
If your question is 'how can I display in SSMS, treeview on the left side, Tables, only tables based on a custom filtering of my choice', then the answer is no, SSMS currently does not have that functionality.

Spell out for us why you're asking this, and perhaps we can give you a workaround.
0
 

Author Comment

by:mike1142
Comment Utility
I have a query in an 8000 table database. I am trying to tune the query. I would like to look at the indexes that are on several of the tables. There is no commonality amongst all of the tables in the query that would work for the filtering function. Excel for instance has a text filter that allows at least 2 filters. Outlook has an advanced filter function to add basically unlimited filters though I find it clumsy.

It's not as simple as just the indexes though. It's helpful to have all of the features of object explorer available , filtered to just the tables I need. I am reasonable though one or two extra I could live with.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
This is why you should not be using the GUI for this.  Instead I would suggest you use a system view. as in:
SELECT *
FROM sys.tables
WHERE name like 'yourfiltergoeshere'

A better approach is to design your tables using schemas, but I suspect it is too late for that.
0
 

Author Comment

by:mike1142
Comment Utility
Can you be more specific? Are there a set of queries/tables that will give me all the information I need?

I did not design the database so sorry about the schema thing.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Can you be more specific? Are there a set of queries/tables that will give me all the information I need?
Sorry I thought I was being specific.  for example, if you want to see all the tables that start with say "Doc" you would do something like this:
SELECT name
FROM sys.tables
WHERE name LIKE 'Doc%'
0
 

Author Comment

by:mike1142
Comment Utility
And that gives you as much information as the GUI does?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Why don't you try it and tell me what you are missing?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:mike1142
Comment Utility
SELECT name
FROM sys.tables
WHERE name LIKE 'Doc%'

Gave me no records so I guess I am missing all of the tables, all of the indexes, all of the columns, all of the data types attached to the columns, all of the statistics, all of the keys, all of the constraints and all of the triggers..
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Here was your original question:
I want to see all tables that begin with or contain XXX and all that have YYY.
If that is the case than the following query will return all the tables that match:
SELECT name
FROM sys.tables
WHERE name LIKE '%XXX%'  OR name '%YYY%
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Gave me no records so I guess I am missing all of the tables,
It merely tells you that you do not have any tables that start with 'Doc%'
0
 

Author Comment

by:mike1142
Comment Utility
Anthony, you are being obtuse. That was not the original question. I have contacted administration, they have seen your comments. I am closing out the question and will entertain no more discussion from you.
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
So for starters, I have dibs on 'No, you can't do that in SSMS' as the answer here.

>There is no commonality amongst all of the tables in the query that would work for the filtering function.
Please explain this statement in greater detail, as it seems to imply that even if there was a filtering function it wouldn't work too well for this purpose.

>Excel for instance has a text filter that allows at least 2 filters. Outlook has an advanced filter function to add basically unlimited filters though I find it clumsy.
Comparing an Office product to SQL Server SSMS is not a valid comparison.  Way different product teams.

Perhaps if you really need this, a better idea would be to restore a COPY of this database from a backup, with all the tables, then programmatically delete the ones you're not going to use until all that's left if what you want to work with.

or

Script out the objects you do want to work with into a Visual Studio 2012 / Database Project, and work out of that UI.
0
 

Author Comment

by:mike1142
Comment Utility
I've requested that this question be closed as follows:

Accepted answer: 0 points for mike1142's comment #a40327056

for the following reason:

because
0
 

Author Comment

by:mike1142
Comment Utility
Thank you all for your time. I will seek other avenues of resolution.
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
The original answer of 'No, you can't do that' stands, which is a valid answer at Experts-Exchange when it is the correct one.

Anthony's suggestion of various SELECT clauses displays the tables, which is not all that you need as you still need indexes, relationships, etc., but as demonstrated it's not possible in SSMS, so in effect 'This is as close as you can get'.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now