在 sql server management studio 中运行任何查询时出错:文件存在

发布于 2024-08-29 12:40:10 字数 242 浏览 5 评论 0原文

当我在 sql server management studio 中运行任何查询时,出现以下错误:

执行批处理时发生错误。错误消息是:文件存在。

重新启动 SSMS 没有帮助。重新启动机器也没有。我在 Google 上发现的唯一内容是有人说“向 microsoft 报告错误”:P

(Windows XP Pro x64, SSMS 2005)

When I run any query in sql server management studio, I get the following error:

An error occurred while executing batch. Error message is: The file exists.

Restarting SSMS didn't help. Neither did rebooting the machine. The only thing I found on Google was someone saying "report the bug to microsoft" :P

(Windows XP Pro x64, SSMS 2005)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

ゝ杯具 2024-09-05 12:40:10

我已经被这个问题困扰了一段时间,当我最近安装 Toad for MySQL 时,我遇到了同样的问题。

我安装了 sysInternals 进程监视器工具来尝试找出导致问题的文件。

答案是临时文件。

SQL Server Management Studio 和 Toad 都对其临时文件使用类似的命名约定。两者都使用“文档和设置”中用户帐户下的临时目录。就我而言,该目录中有超过 6 万个 *.tmp 文件。

通过进程监视器观察查询的执行情况,我可以看到 SQL IDE 不断尝试识别不存在的临时文件名,但始终失败,直到最终放弃并出现“文件存在”错误。

解决方案只是清除本地设置临时目录中的 *.tmp 文件。

SQL Management Studio 和 Toad for MySQL 现在在我的机器上运行良好。

希望这有帮助。

I've been struggling with this one for while and when I recently installed Toad for MySQL I got the same issue.

I installed sysInternals process monitor tool to try and work out which file was causing the issue.

The answer is temp files.

Both SQL server management studio and toad use a similar naming convention for their temp files. Both use the temp directory under your user account in Documents and Settings. In my case, there were over 60 thousand *.tmp files in that directory.

Watching the query execute through process monitor I could see the SQL IDE continually trying and failing to identify a temp file name which didn't exist until it finally gives up with a "The file exists" error.

The solution is simply to clear out the *.tmp files in your local settings temp directory.

Both SQL Management Studio and Toad for MySQL are now working fine on my machine.

Hope this helps.

潇烟暮雨 2024-09-05 12:40:10

进一步了解 Stephen 的答案,路径为:

  • 对于 Windows XP:C:\Documents and Settings\%USERNAME%\Local Settings\Temp
  • 对于 Vista 及更高版本:C:\Users\ %USERNAME%\AppData\Local\Temp
  • 或者只需将 %TEMP% 粘贴到 Windows 资源管理器地址栏中即可获取路径。

我推荐这个小插件,以防您无法访问路线:

取得所有权
http://www.sevenforums.com/tutorials/1911-take-ownership-shortcut.html< /a>

Going further into Stephen's answer, the path would be:

  • For Windows XP: C:\Documents and Settings\%USERNAME%\Local Settings\Temp
  • For Vista and above: C:\Users\%USERNAME%\AppData\Local\Temp
  • Or simply paste %TEMP% into the Windows Explorer address bar to get the path.

I recommend this little plugin in case you can't access the route:

Take Ownership
http://www.sevenforums.com/tutorials/1911-take-ownership-shortcut.html

幻想少年梦 2024-09-05 12:40:10

我在 Windows 8.1 上运行 SQL Server 2012 时遇到了同样的问题。正如@Stephen 提到的,问题出在临时文件上,但我在他提到的位置找不到它们。通过运行磁盘清理并指示其删除临时文件解决了该问题。

I ran into the same issue with SQL Server 2012 running on Windows 8.1. As @Stephen mentioned, the issue is with the temp files but I couldn't find them in the location he mentioned. Solved the problem by running disk cleanup and directing it to delete Temporary Files.

分開簡單 2024-09-05 12:40:10

我已经清除了临时文件,尽管问题没有解决,因此我通过 revo 卸载程序卸载了该软件,从而清除了所有软件日志和软件相关的注册表数据。重新安装后问题解决了

I have cleared temp files although issue was not solved hence I uninstalled the software through revo uninstaller thus it cleared all the software logs and software related registry data. And after re-installing problem was solved

指尖微凉心微凉 2024-09-05 12:40:10

我已经解决了这个问题,在目录上创建另一个文件夹。
只要用户在其中打开新选项卡,SSMS 就会创建编号文件夹。
如果您遇到同样的问题,只需在以下位置创建一个编号文件夹即可
C:\Users%USERNAME%\AppData\Local\Temp 和 SSMS 将不再返回此信息。

I've solved this question creating another folder on directory.
SSMS creates numbered folders anytime the user open a new tab on it.
If you're having the same trouble, just create a numbered folder on
C:\Users%USERNAME%\AppData\Local\Temp and SSMS will return this no more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文