run-sqlcmd
Executes a single sqlcmd batch against a specified SQL Server instance, locally or via SSH, WinRM, or a container, with timeouts and confirmation for emergency operations.
Instructions
dbabrain common.cli run-sqlcmd: One sqlcmd batch, and where to run it.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request):
sql (required): The batch.
instance (required): The -S sqlcmd connects to, as the host running it sees it.
sqlcmd_path: The sqlcmd to run (default sqlcmd).
container: The container the SQL Server runs in: its own sqlcmd runs the batch (docker exec), for a host with no sqlcmd of its own. ssh or local only.
username: A SQL login. With password; give neither for -E.
password: Its RESOLVED value. stdin only.
login_timeout_seconds: sqlcmd -l (default 30).
query_timeout_seconds: sqlcmd -t; 0 = none.
timeout_seconds: The whole run; 0 = none. Past it, the answer says timed_out.
via: local | ssh (a Linux host) | winrm (a Windows host, through a local Invoke-Command).
host: ssh / winrm: host, port, username, a RESOLVED password or key_file, open_timeout_seconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "run-sqlcmd"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |