在尝试打开新的空白查询窗口时,SQL Server Management Studio中的内存不足,没有打开任何查询

时间:2022-09-01 15:46:43

Occurred after a reboot on a machine that had been working fine prior.

在之前工作正常的计算机上重新启动后发生。

Insufficient memory to continue the execution of the program

内存不足,无法继续执行程序

in SQL Server Management Studio (2016, 2017) when attempting to open a new, blank query window.

在SQL Server Management Studio(2016年,2017年)中尝试打开一个新的空白查询窗口时。

I've tried restarting the application, repairing the 2017 install and rebooting.

我已经尝试重新启动应用程序,修复2017安装并重新启动。

Every mention I find of this error involves people attempting to execute too-large queries or queries with result sets that are too big.

我发现这个错误的每一个提及涉及人们试图执行太大的查询或查询结果集太大。

2 个解决方案

#1


1  

This is too large for a comment, but I apologise as it's not really an answer as such; more a long comment.

这对于评论来说太大了,但我道歉,因为它不是真正的答案;更多的评论。

SSMS doesn't tend to release memory after it's used it, and it's only a 32bit application. Thus, if you run a query that does fill up it's full memory allocation (2GB), and then try to run another query (however simple) then you'll get this error.

SSMS在使用后不会释放内存,它只是一个32位应用程序。因此,如果您运行的查询确实填满了它的完整内存分配(2GB),然后尝试运行另一个查询(无论多么简单),那么您将收到此错误。

The solution is to not run queries that are going to be returning huge results sets in SSMS, it's not designed with that in mind. If the user is planning to export it, use a different tool. bcp or sqlcmd are 2 perfected suitable tools. If it's a frequent task for a large data export, you might also want to consider using SSIS. There are, of course, plenty of other options out there, I've just listed a few (Microsoft) options, that are also part of the SQL Server product.

解决方案是不运行将在SSMS中返回大量结果集的查询,它的设计并未考虑到这一点。如果用户计划导出它,请使用其他工具。 bcp或sqlcmd是2个完美的合适工具。如果这是大数据导出的常见任务,您可能还需要考虑使用SSIS。当然,还有很多其他选项,我刚刚列出了一些(Microsoft)选项,它们也是SQL Server产品的一部分。

Either way, SSMS is not designed for returning massive results sets. It's a development tool first, that allows the user to extract data from the result sets it has returned easily.

无论哪种方式,SSMS都不是为返回大量结果集而设计的。它首先是一个开发工具,允许用户从容易返回的结果集中提取数据。

#2


0  

Turns out (in this case) it was a weird share permissions issue. The reboot caused a redirection of the user's HOME folder to remap to a share on the network. Because the machine hadn't been restarted when the policy was put in place, it hadn't taken effect until reboot.

事实证明(在这种情况下)这是一个奇怪的共享权限问题。重新启动导致重定向用户的HOME文件夹以重新映射到网络上的共享。由于在策略实施时机器尚未重新启动,因此在重新启动之前它尚未生效。

This in itself was harmless, but there was an issue with the permissions on the share that hosted the network home folders, which caused the user to not have write privileges to their own home directories.

这本身是无害的,但是托管网络主文件夹的共享上的权限存在问题,这导致用户没有对其自己的主目录的写权限。

This was made apparent later, since the activity of attempting to create a new query window didn't error with a meaningful "can't create file xyz" type error.

这在后来显而易见,因为尝试创建新查询窗口的活动没有错误,带有意义的“无法创建文件xyz”类型错误。

#1


1  

This is too large for a comment, but I apologise as it's not really an answer as such; more a long comment.

这对于评论来说太大了,但我道歉,因为它不是真正的答案;更多的评论。

SSMS doesn't tend to release memory after it's used it, and it's only a 32bit application. Thus, if you run a query that does fill up it's full memory allocation (2GB), and then try to run another query (however simple) then you'll get this error.

SSMS在使用后不会释放内存,它只是一个32位应用程序。因此,如果您运行的查询确实填满了它的完整内存分配(2GB),然后尝试运行另一个查询(无论多么简单),那么您将收到此错误。

The solution is to not run queries that are going to be returning huge results sets in SSMS, it's not designed with that in mind. If the user is planning to export it, use a different tool. bcp or sqlcmd are 2 perfected suitable tools. If it's a frequent task for a large data export, you might also want to consider using SSIS. There are, of course, plenty of other options out there, I've just listed a few (Microsoft) options, that are also part of the SQL Server product.

解决方案是不运行将在SSMS中返回大量结果集的查询,它的设计并未考虑到这一点。如果用户计划导出它,请使用其他工具。 bcp或sqlcmd是2个完美的合适工具。如果这是大数据导出的常见任务,您可能还需要考虑使用SSIS。当然,还有很多其他选项,我刚刚列出了一些(Microsoft)选项,它们也是SQL Server产品的一部分。

Either way, SSMS is not designed for returning massive results sets. It's a development tool first, that allows the user to extract data from the result sets it has returned easily.

无论哪种方式,SSMS都不是为返回大量结果集而设计的。它首先是一个开发工具,允许用户从容易返回的结果集中提取数据。

#2


0  

Turns out (in this case) it was a weird share permissions issue. The reboot caused a redirection of the user's HOME folder to remap to a share on the network. Because the machine hadn't been restarted when the policy was put in place, it hadn't taken effect until reboot.

事实证明(在这种情况下)这是一个奇怪的共享权限问题。重新启动导致重定向用户的HOME文件夹以重新映射到网络上的共享。由于在策略实施时机器尚未重新启动,因此在重新启动之前它尚未生效。

This in itself was harmless, but there was an issue with the permissions on the share that hosted the network home folders, which caused the user to not have write privileges to their own home directories.

这本身是无害的,但是托管网络主文件夹的共享上的权限存在问题,这导致用户没有对其自己的主目录的写权限。

This was made apparent later, since the activity of attempting to create a new query window didn't error with a meaningful "can't create file xyz" type error.

这在后来显而易见,因为尝试创建新查询窗口的活动没有错误,带有意义的“无法创建文件xyz”类型错误。