MSSQL MCP DescribeTable tool only works with SQL Server 2017 (14.x) and later

未关闭
#61 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
sql
领域
databases

调研方向

从 MSSQL MCP DescribeTable 实现开始,检查使用 STRING_AGG 的查询。针对兼容性级别低于 140 的数据库重现该故障,然后确定工具是否应支持该级别。使用较旧的 SQL Server 兼容性设置验证所选择的行为。

由索引模型根据 Issue 内容生成。

描述

MSSQL MCP DescribeTable tool fails with error

{"success":false,"error":"Incorrect syntax near \u0027(\u0027."}

when used with an old SQL server version (or, in my case, a database with a compatibility level lower than 140).

This happens because the STRING_AGG SQL function, which is used in the implementation of DescribeTable, was only introduced in SQL Server 2017 (14.x).

There are other approaches that accomplish the same thing and also work with older version of SQL server, but probably it's not worth it to introduce such a workaround for such old versions.

I was able to work around this issue by increasing the compatibility level of my local database:

alter database current set compatibility_level = 160;
主要语言
HTML
星标
331
派生
208
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure-Samples/SQL-AI-samples 的其他 Issue

查看 Azure-Samples/SQL-AI-samples 的全部 Issue

相似的 Issue

更多 Databases Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。