๐Ÿ” SODA+ AI - Cross-Database Search Guide

Search Objects Across Multiple Databases and Servers


Version: 1.0 | Last Updated: November 2025
Feature: Cross-Database Search | Estimated Time: 15 minutes


๐Ÿ“‘ Table of Contents

  1. Overview
  2. What is Cross-Database Search?
  3. Key Features
  4. How to Access
  5. Search Dialog Options
  6. Search Modes Explained
  7. Match Location Options
  8. AI-Powered Filtering
  9. Search Performance
  10. Search Results Window
  11. Common Use Cases
  12. Performance Tips
  13. Troubleshooting
  14. Keyboard Shortcuts

Overview

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:


Key Features

๐Ÿš€ Performance

๐ŸŒ Multi-Server Support

๐Ÿค– AI-Powered Filtering (Optional)

๐ŸŽฏ Advanced Options


How to Access

Search โ†’ Search Current Server
Search โ†’ Search All Servers

Tip: Use these menu options to start searching across databases!


Search Dialog Options

Search Scope

Radio Buttons:

When to use:


Search Term

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"

Object Types

Checkboxes:

Select at least one - Dialog validates selection

Default: All checked (search everything)


Match Locations

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

Search Mode

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

System Objects

Checkbox:

What gets excluded when checked:

Default: Checked (exclude system objects)

When to uncheck:


Result Limit

Dropdown Options:

Why limit results:

When to use unlimited:

Note: Limit applies globally (not per database)


Database Selection

List Box:

Example:

โ˜‘ AdventureWorks (SERVER01)
โ˜‘ Northwind (SERVER01)
โ˜ master (SERVER01)
โ˜‘ AdventureWorks (SERVER02)

Tips:


Search Modes Explained

1. Contains (Default) - Most Flexible

Best for: General searching, finding variations

How it works:

Example: Search term "Order"

โœ… Matches:
   dbo.CreateOrder
   dbo.GetCustomerOrders
   dbo.OrderHistory
   dbo.ProcessOrderPayment
   sales.CustomerOrderSummary

โŒ Does not match:
   dbo.Customer
   dbo.Payment

2. Exact Match - Precise

Best for: Finding specific object, avoiding partial matches

How it works:

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:

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:

Example: 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")

Match Location Options

1. Object Names โœ… Fastest

Searches:

How it works:

SELECT name FROM sys.objects
WHERE name LIKE @SearchTerm

Speed: โšก Very Fast (~2 seconds for 20 databases)

Use when:


2. Code Definitions โšก Comprehensive

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

3. Column Names ๐Ÿ” Database Schema

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

Combining Match Locations

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-Powered Filtering

What is AI Filtering?

AI filtering uses Grok AI to analyze search results and filter out:

Checkbox:

Requirements:


How AI Filtering Works

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)

AI Filtering Example

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"

When to Use AI Filtering

Use AI Filtering when:

Skip AI Filtering when:


Search Performance

Performance Comparison

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

Multi-Server Performance

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

Performance Factors

Faster:

Slower:


Search Results Window

Results Grid

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

Results Actions

1. Double-Click Row

2. Right-Click Menu

3. Sort Results

4. Filter Results

5. Export Results


Result Statistics

Status Bar Shows:

๐Ÿ” Found 156 results in 18 databases across 3 servers (12.5 seconds)

Information Displayed:


Common Use Cases

Use Case 1: Find All References to a Table

Scenario: You want to modify the Customers table schema and need to find all procedures/views that reference it.

Steps:

  1. Search menu โ†’ Search Current Server
  2. Search term: Customers
  3. Object types: โ˜‘ Stored Procedures, โ˜‘ Views, โ˜‘ Functions
  4. Match locations: โ˜‘ Code Definitions (only)
  5. Search mode: Contains
  6. Click Search

Result: All procedures/views with FROM Customers or JOIN Customers in code


Use Case 2: Find Object by Partial Name

Scenario: You remember a procedure has "Order" in the name but can't remember the full name.

Steps:

  1. Search menu โ†’ Search Current Server
  2. Search term: Order
  3. Object types: โ˜‘ Stored Procedures (only)
  4. Match locations: โ˜‘ Object Names (only)
  5. Search mode: Contains
  6. Click Search

Result: GetCustomerOrders, ProcessOrder, OrderHistory, etc.


Use Case 3: Find All Instances Across Environments

Scenario: You need to update sp_UpdateInventory on all servers (DEV, TEST, PROD).

Steps:

  1. Search menu โ†’ Search All Servers
  2. Search term: sp_UpdateInventory
  3. Object types: โ˜‘ Stored Procedures
  4. Match locations: โ˜‘ Object Names
  5. Search mode: Exact Match
  6. Select all databases
  7. Click Search

Result: Shows every instance with server name, easy to see where to deploy


Use Case 4: Find Tables with Specific Column

Scenario: Find all tables with an EmailAddress column for GDPR audit.

Steps:

  1. Search term: Email
  2. Object types: โ˜‘ Tables (only)
  3. Match locations: โ˜‘ Column Names (only)
  4. Search mode: Contains
  5. Exclude system objects: โ˜‘ Yes
  6. Click Search

Result: All user tables with columns containing "Email"


Use Case 5: Code Audit - Remove Deprecated Procedure Calls

Scenario: dbo.OldProcedure is deprecated. Find all procedures that call it.

Steps:

  1. Search term: OldProcedure
  2. Object types: โ˜‘ Stored Procedures
  3. Match locations: โ˜‘ Code Definitions (only)
  4. Search mode: Contains
  5. AI filtering: โ˜‘ Enabled (remove commented references)
  6. Click Search

Result: Only active calls to OldProcedure (comments filtered out)


Use Case 6: Find All Objects by Naming Convention

Scenario: Find all procedures starting with sp_Get for documentation.

Steps:

  1. Search term: sp_Get
  2. Object types: โ˜‘ Stored Procedures
  3. Match locations: โ˜‘ Object Names
  4. Search mode: Starts With
  5. Click Search

Result: sp_GetCustomer, sp_GetOrders, sp_GetInventory, etc.


Performance Tips

Optimize Search Speed

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

Troubleshooting

Problem: No Results Found

Possible Causes:

  1. Search term doesn't match any objects
  2. All matching objects are system objects (excluded)
  3. Match location filters too restrictive
  4. Wrong databases selected

Solutions:


Problem: Too Many Results

Possible Causes:

  1. Search term too generic (e.g., "a", "id")
  2. "Contains" mode too broad
  3. All databases selected
  4. No result limit

Solutions:


Problem: Search is Slow

Possible Causes:

  1. Too many databases (50+)
  2. "Code Definitions" match location enabled
  3. AI filtering enabled
  4. Unlimited results

Solutions:


Problem: AI Filtering Unavailable

Error Message: "AI filtering unavailable"

Possible Causes:

  1. Not logged in
  2. "Search inside code" not enabled
  3. No Grok API key assigned

Solutions:


Problem: Permission Denied

Error Message: "Permission denied accessing database"

Possible Causes:

  1. User lacks VIEW DEFINITION permission
  2. Database in recovery mode
  3. Database offline

Solutions:


Problem: Multi-Server Search Failed

Error Message: "Multi-server search failed on some servers"

Possible Causes:

  1. Connection timeout
  2. Authentication failure
  3. Network issues
  4. Server offline

Solutions:


Problem: Search Results Not Opening in Analyzer

Possible Causes:

  1. Maximum 10 analyzer tabs already open
  2. Object type not supported for analysis

Solutions:


Keyboard Shortcuts

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

Additional Resources

Related Features:

Documentation:


Summary

Cross-Database Search is:

Best Practices:

  1. Start with "Names Only" for quick lookups
  2. Use "Contains" mode for exploratory searching
  3. Enable AI filtering for high-precision code searches
  4. Limit results to 500 for performance
  5. Use multi-server search for environment-wide analysis

Remember:



End of Search Feature Guide | Version: 1.0 | Last Updated: November 2025
For more help: See Full User Guide

โ†‘ Top