Query Pilot Database First
Help ID: query-runner.database-first
Database first is a repo-mode workflow for starting with the database name instead of the server list.
Enter a database name and click Find servers. Query Pilot checks repository database inventory and returns servers that currently have that database. Select the servers to use and click Apply.
Apply updates the shared target picker, turns on Show only selected, pins those servers to the active query tab, and selects the database for the tab.
Scenarios
Find Every Server That Hosts a Customer Database
Problem: you know the database name, but not which servers currently host it. This happens during estate cleanup, migrations, application support, and AG failover review.
Use Database First to search for the database, review the matching servers, select the ones you want, and apply them to the active query tab. Query Pilot then uses the normal target-picker path, so the tab clearly shows which servers are pinned and which database is selected.
Run a Consistency Check Across Every Copy
Problem: a database exists on multiple servers and you need to compare a setting, row count, version table, or object state across all copies.
Use Database First to select every server that has the database, then run a query such as:
SELECT @@SERVERNAME AS ServerName,
DB_NAME() AS DatabaseName,
COUNT(*) AS RowCount
FROM dbo.SomeTable;
Because the database selection is tied to the query tab, the same script can fan out across the chosen servers without manually hunting through the full server list.
Avoid Running Against the Wrong Fleet
Problem: the main target picker may already have a broad set of servers checked from another task.
Database First narrows the target picker to only servers that have the selected database and enables Show only selected. That makes the active query tab's execution scope visible before Run, instead of relying on memory or a manually filtered server list.
Related: Query Pilot, Targets.
Documentation revision: 461C8CCDDD6AC8E7