sqlserver

Run read-only SQL Server queries and manage schema migrations over pyodbc with named connection profiles.

4|2|Updated Sep 1, 2026
One-click install
npx skills add https://github.com/Procesio-Externals/procesio-cli --skill sqlserver-procesio-externals
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sqlserver
Source: https://github.com/Procesio-Externals/procesio-cli/tree/main/tools/sqlserver
Command: npx skills add https://github.com/Procesio-Externals/procesio-cli --skill sqlserver-procesio-externals

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyodbc.

What problem does it solve? Querying SQL Server from scripts or an AI assistant usually means hand-writing connection strings, risking accidental writes, and leaking credentials into files. This Skill provides a JSON-in/JSON-out command interface with SELECT-only enforcement by default, parameterised queries, and passwords stored only in the OS credential manager. ## Core Features & Use Cases - Safe querying: Run SELECT queries with bound ? parameters, row caps, and a write guard that blocks INSERT/UPDATE/DDL unless --write is explicitly passed. - Schema introspection and mirroring: List tables and columns, extract every database object to local .sql files, and diff two mirrors or live databases. - Versioned migrations: Apply forward-only NNNN_slug.sql migrations tracked in dbo.__schema_migrations, with drift detection, danger warnings, and dry-run validation in rolled-back transactions. - Use Case: Ask the assistant to compare the schema of a dev database against a release database, then generate and dry-run a migration script before applying it to a sandbox environment. ## Quick Start Ask the assistant to run a read-only query such as "SELECT TOP 10 * FROM dbo.Customer" against the default SQL Server profile and return the rows as JSON.

Frequently Asked Questions about sqlserver

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a read-only SQL Server query from the command line?▼

Use the query action with a profile and SQL text: sqlserver query --profile default --sql "SELECT TOP 10 * FROM dbo.Customer". Parameters are passed as a JSON array via --params and bound through ? placeholders, never interpolated into the SQL string.

How do I compare schemas between two SQL Server databases?▼

Use schema-diff with two mirror directories or two live profiles, e.g. --left profile:dev --right profile:release. It reports objects added, removed, and changed, with unified diffs per object unless --no-diff-text is passed.

Where are SQL Server passwords stored when using connection profiles?▼

Passwords live only in the operating system credential store under agents-and-tools:sqlserver:<profile-name>, set via scripts/set-credential.py. The profiles.json file holds only non-secret config such as server, database, username, and TLS flags.

Can I run UPDATE or DDL statements with this tool?▼

Yes, but only by passing --write explicitly. Without it, the read-only guard rejects INSERT, UPDATE, DELETE, DDL, EXEC, and multi-statement batches with a write_blocked error, and read-only profiles also set ApplicationIntent=ReadOnly.

Why does the tool fail with missing_dependency on a new machine?▼

pyodbc and a Microsoft ODBC Driver for SQL Server (17 or 18) must both be installed. The driver is not bundled with Python; install it with winget install Microsoft.msodbcsql.18, after which profile management and queries work.

What are the limitations of the schema extraction and migration runner?▼

Extraction does not yet cover CLR assemblies, user-defined types, sequences, synonyms, or Service Broker objects. GO-batch splitting is line-based, so a GO line inside a string literal is treated as a separator, and there are no down migrations.