sql-server-query

Runs read-only sqlcmd queries against SQL Server databases of .NET applications on Windows.

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/ulebule/claude-skills --skill sql-server-query-ulebule
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-server-query
Source: https://github.com/ulebule/claude-skills/tree/main/plugins/sql-server-query/skills/sql-server-query
Command: npx skills add https://github.com/ulebule/claude-skills --skill sql-server-query-ulebule

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working with an unfamiliar .NET codebase, finding the right database connection string and safely querying its SQL Server database is tedious and error-prone, especially with legacy .NET Framework projects, encrypted configs, or LocalDB setups. ## Core Features & Use Cases - Automatic connection string discovery: Searches appsettings.json, user secrets, web.config/app.config, docker-compose files, and EF6/EDMX embedded strings, including encrypted connectionStrings sections. - Legacy .NET Framework support: Handles config transforms, class library config pitfalls, LocalDB, SQLEXPRESS, OLE DB strings, and old-server TLS quirks. - Safe read-only querying: Builds sqlcmd commands with Windows or SQL authentication and enforces SELECT-only rules with TOP N limits. - Use Case: You open an unfamiliar legacy ASP.NET project and need to check what columns a table has — the skill locates the connection string in web.config, connects via sqlcmd, and returns the schema without any manual setup. ## Quick Start Ask the assistant to look in the database and show the structure of a specific table in this project.

Frequently Asked Questions about sql-server-query

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

FAQPage Schema
How do I query a SQL Server database from a .NET project I don't know?

Search the repository for connection strings in appsettings.json, user secrets, web.config, or docker-compose files, then connect with sqlcmd using the parsed server, database, and authentication mode. The skill automates this discovery order and builds the command for you.

How to find the connection string in a legacy .NET Framework application?

Check web.config for web apps or app.config for desktop apps under the connectionStrings element, and watch for config transforms like Web.Debug.config. For EF6/EDMX, extract the inner provider connection string from the metadata-wrapped value.

Can sqlcmd connect to LocalDB or SQL Server Express instances?

Yes, sqlcmd connects to LocalDB with -S "(LocalDB)\MSSQLLocalDB" -E, and you can start the instance with sqllocaldb start MSSQLLocalDB. SQLEXPRESS works the same way using the .\SQLEXPRESS server name.

Why does sqlcmd fail with TLS or certificate errors on older SQL Servers?

Older servers like SQL 2008/2012 often lack TLS 1.2 support required by the modern go-sqlcmd. Add -C to trust the certificate, and if that fails add -N o to disable encryption or use the classic ODBC sqlcmd from SSMS.

Can this skill run INSERT, UPDATE, or DELETE statements?

No, it is read-only by default and only runs SELECT queries plus metadata commands like sp_helptext and sp_fkeys. Write operations require the user to explicitly request one specific statement.