如何将Sqlcmd连接到服务器?
问题描述:
我刚刚安装了 SQL Server 2008,我想使用命令编辑器来执行查询.
I just installed SQL Server 2008, and I wanted to use the command editor to execute queries.
为此,我打开了命令提示符,然后输入了
To do that I opened the command prompt, and I typed
Sqlcmd -S Serverinstance
但我收到一条错误消息:
but I got an error saying :
命名管道提供程序:无法打开与 SQL Server [53] 的连接.
Sqlcmd:错误:Microsoft SQL Server Native Client 10.0:建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.检查实例名称是否正确以及 SQL Server 是否配置为允许远程连接.有关详细信息,请参阅 SQL Server 联机丛书..
Sqlcmd:错误:Microsoft SQL Server Native Client 10.0:登录超时
我应该怎么做才能将它连接到服务器以便我可以继续?
What should I do to get it connected to the server so I can proceed?
谢谢:D.
答
(这个听起来很傻)我的问题是我没有使用大写的S"
(This one is going to sounds silly) my problem was that I wasn't using capital 'S'
例如:
C:\> SQLCMD -S localhost\sqlexpress