switch_database
Change the active database context in SQL Server to execute queries on different databases. Use this tool to switch between databases within a session.
Instructions
Switch the active database context.
Changes the current database using the USE statement. The database must
exist, be online, and not be in the blocklist (MSSQL_BLOCKED_DATABASES).
Args:
database_name: Name of the database to switch to
Returns:
Dictionary with:
- status: "switched" on success, "error" on failure
- database: The new active database name
- previous_database: The previously active database
- error: Error message if switch failedInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||