Install
openclaw skills install mssqlExecute SQL Server queries and export results as delimiter-separated text. Use when the user asks to fetch, insert, update, or manage data in Microsoft SQL Server, validate BI/reporting numbers, or prepare datasets for charts.
openclaw skills install mssqlRun SQL Server queries using scripts/mssql_query.sh.
~/.openclaw/credentials/mssql.envbash skills/mssql/scripts/mssql_query.sh --query "SELECT TOP 20 name FROM sys.tables"bash skills/mssql/scripts/mssql_query.sh --query "SELECT TOP 100 * FROM dbo.MyTable" --out /tmp/mytable.dsvExpected env vars in ~/.openclaw/credentials/mssql.env:
MSSQL_HOSTMSSQL_DBMSSQL_USERMSSQL_PASSWORDMSSQL_PORT (default 1433), MSSQL_ENCRYPT (yes/no, default yes), MSSQL_TRUST_CERT (yes/no, default no), SQLCMD_BINThe credential file path can be overridden with the MSSQL_ENV_FILE environment variable.
Query permissions are controlled entirely at the SQL Server user level. The script does not impose any restrictions on query type — the database user's grants determine what is allowed.
Place your database map at references/DB_MAP.md inside this skill folder. This file tells the agent which databases, schemas, and tables to use and how they relate to each other.
See references/DB_MAP.example.md for the expected format.
bash skills/mssql/scripts/mssql_query.sh --file /path/query.sql --out /tmp/out.dsvbash skills/mssql/scripts/mssql_query.sh --db OtherDB --query "SELECT TOP 10 * FROM dbo.Users"bash skills/mssql/scripts/mssql_query.sh --query "SELECT ..." --delim ","bash skills/mssql/scripts/mssql_query.sh --query "SELECT ..." --timeout 180Output is delimiter-separated text, not RFC 4180 CSV. Fields are not quoted or escaped. This works well for structured numeric and short-text data. If your columns contain embedded delimiters, quotes, or newlines, the output may be malformed — choose a delimiter that does not appear in the data, or post-process the output.
SELECT *.TOP for exploratory samples.sqlcmd not found -> install sqlcmd v18+ or set SQLCMD_BIN.MSSQL_TRUST_CERT=yes in your credentials file. The default is no (certificate validation enabled).