sqlcmd.exe - 共享内存提供程序:管道的另一端没有进程 [英] sqlcmd.exe - Shared Memory Provider: No process is on the other end of the pipe

查看:23
本文介绍了sqlcmd.exe - 共享内存提供程序:管道的另一端没有进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了大量关于该错误的帖子和文章:

I have read numerous posts and articles about the error:

共享内存提供程序:管道的另一端没有进程.通信链路故障.

Shared Memory Provider: No process is on the other end of the pipe. Communication link failure.

...包括这些:

错误信息:(提供程序:共享内存提供程序,错误:0 - 管道的另一端没有进程.)

https://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

我可以轻松且始终通过 SSMS 进行连接,包括混合模式和 Windows 身份验证.但是每当我尝试通过 sqlcmd.exe 运行 sql 脚本时,我都会收到上面显示的错误.

I can connect easily and always from SSMS, both from Mixed Mode and Windows Authentication. But whenever I try to run a sql script via sqlcmd.exe, I get the error shown above.

这是我从 Windows 命令外壳运行的内容:

Here is what I am running from windows command shell:

"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\sqlcmd.exe" -S localhost -U sa -P myPassword -i "F:\<mypath>\<myfile>.sql"

这是我尝试/验证过的:

Here is what I have tried/verified:

  1. 我在 Windows 10 上运行 SQL Server 14.0 版.
  2. 混合模式身份验证已启用,我可以从 SSMS 连接.
  3. 我尝试在我的 cmd 行中指定 127.0.0.1 而不是 localhost.
  4. 共享内存协议已启用.
  5. 已启用命名管道协议.
  6. TCP/IP 已启用.
  7. 我的 SQL Server 服务正在运行 - 我可以从 SSMS 连接.
  8. 我在 Windows 防火墙中打开了入站和出站端口 1433,我的防火墙允许 SQL Server(作为应用程序).(即使我关闭了防火墙,我仍然会遇到同样的错误.)
  9. 远程连接已启用.
  10. SQL Server Browser 服务已启用并正在运行.
  11. SQL Server 代理已启用并正在运行(尽管我认为这没有必要).
  12. 我重新启动了 SQL Server 服务并重新启动了几次.

最重要:这一定与我的输入文件有关,它超过 200 Mb.当我运行与上面相同的 cmd-line 语句,而是指向 test.sql 时,它只包含 select getdate(),它完美地工作.没有错误,没有连接问题.

MOST IMPORTANT: This must have something to do with my input file, which is over 200 Mb. When I run the same cmd-line statement as above, but instead point to test.sql, which contains nothing more than select getdate(), it works perfectly. No errors, no connection problems.

在我尝试了一切之后,我永远得到同样的错误.我还能尝试什么?

After everything I have tried, I forever get that same error. What else can I try?

推荐答案

感谢 这篇文章.我不得不添加 -a 32767 作为 cmd-line 参数,大概是因为我的输入脚本很大.Infernal sqlcmd 可以给出更真实的错误消息,而不是假装它无法连接.连接从来都不是问题.无论如何,我希望这可以帮助其他人.

I finally figured it out thanks to this post. I had to add -a 32767 as a cmd-line param, presumably because of the massive size of my input script. Infernal sqlcmd could have given a more truthful error message instead of pretending it couldn't connect. The connection was never the problem. Anyway I hope this can help someone else.

这篇关于sqlcmd.exe - 共享内存提供程序:管道的另一端没有进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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