当我尝试运行sqlcmd(从cmd提示符)时,我收到以下错误:
HResult 0x2,Level 16,State 1 Named Pipes Provider: Could not open a connection to SQL Server [2]. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in stance-specific error has occurred while establishing a connection to SQL Server . Server is not found or not accessible. Check if instance name is correct and i f SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.
不知道为什么会这样?我可以从我的asp.net网站(在本地运行,如数据库)连接到sql server,但sqlcmd无法连接.
解决方法
尝试sqlcmd -S< InstanceName>
>只有将服务器安装为默认实例时,您的命令才有效.>运行sp_helpserver以了解实例名称. (编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|