Version: 1.0 | Last Updated: November 2025
Feature: Cross-Database Search | Estimated Time: 15 minutes
Cross-Database Search is a powerful feature that allows you to search for database objects across multiple databases and servers simultaneously. It supports searching object names, code definitions, column names, and more, with optional AI-powered relevance filtering.
What makes it special:
Cross-Database Search searches for database objects across:
Search Targets:
Search Scope:
Search โ Search Current Server
Search โ Search All Servers
Tip: Use these menu options to start searching across databases!
Radio Buttons:
When to use:
Text Input:
Example: Customer
Tips:
Examples:
Search Term Finds
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Customer All objects with "Customer"
dbo.Get Objects in dbo schema with "Get"
sp_ All objects starting with "sp_"
Order Tables, views, procedures with "Order"
Checkboxes:
Select at least one - Dialog validates selection
Default: All checked (search everything)
Checkboxes:
Select at least one - Dialog validates selection
Default: All checked (comprehensive search)
How it works:
Example: Searching for "Customer"
| Match Location | Finds |
|---|---|
| Names Only | dbo.GetCustomer (procedure name) |
| Code Only | Procedures with SELECT * FROM Customers in code |
| Columns Only | Tables with CustomerID column |
| All Three | All of the above |
Dropdown Options:
| Mode | Behavior | Example (Search: "Get") |
|---|---|---|
| Contains | Anywhere in name | GetCustomer, CustomerGetter, TargetGet |
| Exact Match | Exact name only | Get (only) |
| Starts With | Beginning of name | GetCustomer, GetOrder |
| Ends With | End of name | CustomerGet, OrderGet |
Default: Contains (most flexible)
SQL Pattern Translation:
Contains โ %Get%
Exact Match โ Get
Starts With โ Get%
Ends With โ %Get
Checkbox:
What gets excluded when checked:
is_ms_shipped = 1 (Microsoft-shipped objects)sp_ (system stored procedures)dt_ (data tools procedures)Default: Checked (exclude system objects)
When to uncheck:
Dropdown Options:
Why limit results:
When to use unlimited:
Note: Limit applies globally (not per database)
List Box:
Example:
โ AdventureWorks (SERVER01)
โ Northwind (SERVER01)
โ master (SERVER01)
โ AdventureWorks (SERVER02)
Tips:
master, msdb, tempdb for user databases onlyBest for: General searching, finding variations
How it works:
%searchTerm%Example: Search term "Order"
โ
Matches:
dbo.CreateOrder
dbo.GetCustomerOrders
dbo.OrderHistory
dbo.ProcessOrderPayment
sales.CustomerOrderSummary
โ Does not match:
dbo.Customer
dbo.Payment
Best for: Finding specific object, avoiding partial matches
How it works:
searchTerm (no wildcards)Example: Search term "Order"
โ
Matches:
dbo.Order (exact match only)
โ Does not match:
dbo.Orders (plural)
dbo.CreateOrder (has prefix)
dbo.CustomerOrder (has prefix)
Best for: Naming conventions, finding object families
How it works:
searchTerm%Example: Search term "Get"
โ
Matches:
dbo.GetCustomer
dbo.GetOrders
dbo.GetUserProfile
โ Does not match:
dbo.CustomerGet (doesn't start with "Get")
dbo.RetrieveCustomer (different prefix)
Best for: Finding objects by type suffix
How it works:
%searchTermExample: Search term "Report"
โ
Matches:
dbo.SalesReport
dbo.CustomerActivityReport
dbo.MonthlyFinancialReport
โ Does not match:
dbo.ReportGenerator (doesn't end with "Report")
dbo.ReportingTools (has suffix after "Report")
Searches:
How it works:
SELECT name FROM sys.objects
WHERE name LIKE @SearchTerm
Speed: โก Very Fast (~2 seconds for 20 databases)
Use when:
Searches:
How it works:
SELECT o.name, m.definition
FROM sys.objects o
JOIN sys.sql_modules m ON o.object_id = m.object_id
WHERE m.definition LIKE @SearchTerm
Speed: ๐ข Slower (~10-20 seconds for 20 databases)
Use when:
Example: Search "CustomerID"
Finds procedures with:
SELECT * FROM Orders WHERE CustomerID = @ID
UPDATE Customers SET Status = 1 WHERE CustomerID = @ID
Searches:
How it works:
SELECT t.name, c.name
FROM sys.tables t
JOIN sys.columns c ON t.object_id = c.object_id
WHERE c.name LIKE @SearchTerm
Speed: โก Fast (~3-5 seconds for 20 databases)
Use when:
Example: Search "Email"
Finds tables with:
Users.EmailAddress
Customers.Email
ContactInfo.EmailVerified
Recommended Combinations:
| Combination | Speed | Use Case |
|---|---|---|
| Names Only | โกโกโก Fast | Quick object lookup |
| Names + Columns | โกโก Fast | Schema analysis |
| Names + Code | ๐ข Slow | Comprehensive search |
| All Three | ๐ข๐ข Slowest | Complete inventory |
Example: Search "Customer" with all three:
Names: dbo.Customers (table name)
dbo.GetCustomer (procedure name)
Code: dbo.ValidateOrder (has "SELECT * FROM Customers")
dbo.ProcessPayment (has "WHERE CustomerID = @ID")
Columns: Orders.CustomerID
Sales.CustomerName
AI filtering uses Grok AI to analyze search results and filter out:
-- SELECT * FROM Customers)Checkbox:
Requirements:
Step 1: Normal Search
-- Finds 100 results mentioning "Customer"
Step 2: AI Analysis
For each result:
1. Send SQL code to Grok AI
2. AI analyzes: Is "Customer" actively used?
3. AI returns: IsActive (bool) + Confidence (0-100)
4. Filter out: IsActive = false
Step 3: Filtered Results
100 results โ 65 relevant results
(35 filtered out as comments/dead code)
Without AI Filtering:
โ
Result 1: Active code
CREATE PROCEDURE GetCustomer
AS
SELECT * FROM Customers WHERE Active = 1
โ
Result 2: Commented code (false positive)
CREATE PROCEDURE GetOrder
AS
-- Old code: SELECT * FROM Customers
SELECT * FROM Orders
โ
Result 3: String literal (false positive)
CREATE PROCEDURE LogMessage
AS
INSERT INTO Logs VALUES ('Checking Customers table')
With AI Filtering:
โ
Result 1: Active code (Confidence: 95%)
Reasoning: "Customer table actively queried"
โ Result 2: Filtered out (Confidence: 10%)
Reasoning: "Reference is in commented code"
โ Result 3: Filtered out (Confidence: 15%)
Reasoning: "Mention is in string literal only"
Use AI Filtering when:
Skip AI Filtering when:
| Search Type | Speed | Databases | Time |
|---|---|---|---|
| Names Only | โกโกโก Fast | 20 | ~2 sec |
| Names + Columns | โกโก Fast | 20 | ~5 sec |
| Names + Code | ๐ข Slow | 20 | ~15 sec |
| All Three | ๐ข๐ข Slower | 20 | ~20 sec |
| With AI Filter | ๐ข๐ข๐ข Slowest | 20 | ~50 sec |
| Servers | Databases | Time (Names) | Time (All + AI) |
|---|---|---|---|
| 1 | 10 | 1 sec | 15 sec |
| 3 | 30 | 3 sec | 45 sec |
| 5 | 50 | 5 sec | 90 sec |
| 10 | 100 | 10 sec | 180 sec |
Faster:
Slower:
Columns:
| Column | Description |
|--------|-------------|
| Server | SQL Server name |
| Database | Database name |
| Schema | Object schema (e.g., dbo) |
| Object | Object name |
| Type | Object type (Table, View, Procedure, Function) |
| Match Type | Where it matched (Name, Code, Column) |
Example:
Server Database Schema Object Type Match
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SERVER01 AdventureWorks dbo Customers User Table Name
SERVER01 AdventureWorks dbo GetCustomer Stored Procedure Name
SERVER01 AdventureWorks dbo ValidateOrder Stored Procedure Code
SERVER01 Northwind dbo Orders User Table Column
SERVER02 AdventureWorks sales CustomerOrders View Name
1. Double-Click Row
2. Right-Click Menu
3. Sort Results
4. Filter Results
5. Export Results
Status Bar Shows:
๐ Found 156 results in 18 databases across 3 servers (12.5 seconds)
Information Displayed:
Scenario: You want to modify the Customers table schema and need to find all procedures/views that reference it.
Steps:
CustomersResult: All procedures/views with FROM Customers or JOIN Customers in code
Scenario: You remember a procedure has "Order" in the name but can't remember the full name.
Steps:
OrderResult: GetCustomerOrders, ProcessOrder, OrderHistory, etc.
Scenario: You need to update sp_UpdateInventory on all servers (DEV, TEST, PROD).
Steps:
sp_UpdateInventoryResult: Shows every instance with server name, easy to see where to deploy
Scenario: Find all tables with an EmailAddress column for GDPR audit.
Steps:
EmailResult: All user tables with columns containing "Email"
Scenario: dbo.OldProcedure is deprecated. Find all procedures that call it.
Steps:
OldProcedureResult: Only active calls to OldProcedure (comments filtered out)
Scenario: Find all procedures starting with sp_Get for documentation.
Steps:
sp_GetResult: sp_GetCustomer, sp_GetOrders, sp_GetInventory, etc.
1. Narrow Search Scope
โ Slow: All Servers + All Databases + All Match Locations
โ
Fast: Current Server + Selected Databases + Names Only
2. Use Specific Search Terms
โ Slow: "a" (matches everything)
โ
Fast: "GetCustomer" (specific)
3. Choose Right Search Mode
โ Slow: Contains (broadest)
โ
Fast: Exact Match (narrowest)
4. Limit Result Count
โ Slow: Unlimited results
โ
Fast: 500 results limit
5. Skip AI Filtering When Possible
โ Slow: AI filtering on 200 results (+60 seconds)
โ
Fast: No AI filtering (instant)
Quick Object Lookup:
Match Locations: Names only
Search Mode: Exact Match
Result Limit: 100
Speed: โกโกโก 1-2 seconds
Schema Analysis:
Match Locations: Names + Columns
Search Mode: Contains
Result Limit: 500
Speed: โกโก 3-5 seconds
Comprehensive Code Search:
Match Locations: All three
Search Mode: Contains
Result Limit: 500
AI Filtering: No
Speed: ๐ข 15-20 seconds
High-Precision Code Search:
Match Locations: Code only
Search Mode: Contains
Result Limit: 500
AI Filtering: Yes
Speed: ๐ข๐ข 45-60 seconds
Possible Causes:
Solutions:
Possible Causes:
Solutions:
Possible Causes:
Solutions:
Error Message: "AI filtering unavailable"
Possible Causes:
Solutions:
Error Message: "Permission denied accessing database"
Possible Causes:
Solutions:
Error Message: "Multi-server search failed on some servers"
Possible Causes:
Solutions:
Possible Causes:
Solutions:
| Shortcut | Action | Context |
|---|---|---|
| Enter | Execute search | Search dialog |
| Escape | Close dialog | Search dialog |
| Ctrl+A | Select all databases | Database list |
| Ctrl+C | Copy selected result | Results window |
| F5 | Refresh results | Results window |
| Double-Click | Open in Dependency Analyzer | Results row |
Related Features:
Documentation:
Cross-Database Search is:
Best Practices:
Remember:
End of Search Feature Guide | Version: 1.0 | Last Updated: November 2025
For more help: See Full User Guide