Blog

SQL Object Search Box: Finding a Needle in a Haystack Made Easy

By Don Kiely | November 19, 2012

ldn-expertdkiely

A medium sized database can easily have hundreds or thousands of objects, and large databases can have even more. And if there are several databases in an instance of SQL Server, the number is magnified even more. When you need to find a specific object, such as a specific code module with "customer" in the name, finding a needle in the proverbial haystack can seem easy in comparison. It can be tedious to click around Object Explorer to find an object, particularly if you can't remember the first few letters of the object name. It may have "customer" in the name, but it could start with other characters, such as GetCustomerList.

That's when the Object Search box comes in handy. It's not actually part of the Object Explorer Details view, but appears at the top of the view. The figure below shows a search for %customer% across all databases (the Databases node was selected in Object Explorer before performing the search). The % characters in the search string are wild card characters, so that any number of characters can appear in the name before and after "customer." If you know the exact name of the object, you don't have to use wild card characters.

The figure below shows the same search with the Northwind database node selected in Object Explorer. Because the search is looking in only a single database, the scope of the search is narrower and search returns fewer objects. Notice that the search result message near the top of the window indicates the scope, since it is no longer across all databases.

sql server

This post is an excerpt from the online courseware for our SQL Server 2012: Installing course written by expert Don Kiely.



Don Kiely

Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor, and consultant specializing in Microsoft technologies. Don has many years of teaching experience, is the author or co-author of several programming books, and has spoken at many industry conferences and user groups. In addition, Don is a consultant for a variety of companies that develop distributed applications for public and private organizations.


This blog entry was originally posted November 19, 2012 by Don Kiely