WITHIN GROUP不在SSMS 17.9.1中工作 [英] WITHIN GROUP not working in SSMS 17.9.1

查看:77
本文介绍了WITHIN GROUP不在SSMS 17.9.1中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下查询:

	select
		HcrHisId,
		ChangeReasonsCode = STRING_AGG(HcrCode, ';') WITHIN GROUP (ORDER BY HcrCode),
		ChangeReasonsDescription = STRING_AGG(HcrDisplayValue, ';')  WITHIN GROUP (ORDER BY HcrCode)
	from HistoryChangeReason
	group by HcrHisId




我可以使用SSMS 17.4在我自己的开发机器上运行SSMS。但是,对于同一个SQL Server实例/数据库,另一个开发人员在SSMS 17.9.1中收到语法错误:

I can run this from SSMS on my own development machine using SSMS 17.4. However, against the same SQL Server instance/database, another developer gets syntax errors in SSMS 17.9.1:

第3行,第78列

语法不正确, 。

Line 3, column 78
Incorrect syntax near ,.

我们现在尝试使用SSMS 17.9.1的几个不同的盒子(包括我,而不是其他开发人员,以确保没有一些奇怪的安全问题),他们都无法执行此查询。这是SSMS较新版本中的错误吗?或者SSMS中是否有一些
配置必须设置为使其使用我刚刚设置的更新的SQL Server功能,这些其他框没有?

We've now tried several different boxes with SSMS 17.9.1 (including as me, instead of the other developer to make sure there wasn't some weird security issue) and they all fail to execute this query. Is this a bug in newer versions of SSMS? Or is there some configuration in SSMS that has to be set to make it use newer SQL Server features that I happen to have set that these other boxes don't?

推荐答案

SSMS不运行查询。它将查询发送到SQL Server以供执行。那么你使用哪个版本的SSMS并不重要,结果将是相同的。

SSMS does not run queries. It sends queries to SQL Server for execution. So which version of SSMS you use does not matter, the result will be the same.

Intellinonsense是另一回事。一个版本的SSMS可能会发出错误信号,而另一个版本可能没有。我猜这个消息来自Intellisense,因为有一个列号;来自SQL Server的错误消息永远不会有列号。
但你可以安全地忽略这个令人不安的功能产生的噪音 - 或完全关闭以避免被误导。

Intellinonsense is another matter. One version of SSMS may signal an error where another version may not. And I would guess that this message comes from Intellisense, since there is a column number; error messages from SQL Server never have column numbers. But you can safe ignore the noise from this disturbing feature - or turn off entirely to avoid being mislead.

我复制到你查询查询窗口,并启用智能感知。由于缺少表格,我得到了不少红色曲线,但没有任何语法错误的迹象。

I copied to you query to a query window, and enabled Intellisense. I got quite a few red squiggles because of the missing tables, but there was not any sign of syntax errors.


这篇关于WITHIN GROUP不在SSMS 17.9.1中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆