简体   繁体   English

SQLCMD没有找到SQL Server

[英]SQLCMD is not finding SQL Server

Windows 10: When I run SQLCMD in an elevated command window I get the error: Windows 10:当我在提升的命令窗口中运行SQLCMD时,我收到错误:

Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [2]. Sqlcmd:错误:Microsoft SQL Server Native Client 11.0:命名管道提供程序:无法打开与SQL Server的连接[2]。 .

I am a complete beginner. 我是一个完全的初学者。 I have Visual Studio 2013 installed and started and sqlservr.exe is running. 我安装并启动了Visual Studio 2013,并且sqlservr.exe正在运行。 I have not installed anything else - like SQL Server Express. 我没有安装任何其他东西 - 比如SQL Server Express。 I thought a version of SQL Server 2012 came with Visual Studio 2013. There are 14 SQL Server type things installed (examples: Microsoft SQL Server 2012 Management Objects. Also Microsoft SQL Server 2012 Express LocalDB and Microsoft SQL Server Compact 4.0 SP1 x64 ENU.) 我认为SQL Server 2012的一个版本随Visual Studio 2013一起提供。安装了14个SQL Server类型的东西(例如:Microsoft SQL Server 2012管理对象。还有Microsoft SQL Server 2012 Express LocalDB和Microsoft SQL Server Compact 4.0 SP1 x64 ENU。)

I want to learn SQL Server projects in Visual Studio 2013. 我想学习Visual Studio 2013中的SQL Server项目。

Use SQL Server Configuration Manager to enable Named Pipes. 使用SQL Server Configuration Manager启用命名管道。

SQL Server Configuration Manager (local) SQL Server配置管理器(本地)
SQL Native Client XX.0 Configuration (XXbit) SQL Native Client XX.0配置(XXbit)
Client Protocols 客户端协议
Named Pipes -> Enabled 命名管道 - >已启用

Then restart the SQL Server instance from SQL Server Services menu 然后从SQL Server Services菜单重新启动SQL Server实例

Also this will produce a service stop, so make sure it is ok for any users who might be using these databases (but I guess you will be the only one since it is a local instance). 此外,这将产生服务停止,因此请确保可能正在使用这些数据库的任何用户都可以使用(但我想您将是唯一一个因为它是本地实例的用户)。

You could also use TCP/IP Protocol instead of Named pipes, if you have to precise which port to open go to SQL Server Network Configuration 您还可以使用TCP / IP协议而不是命名管道,如果您必须精确打开哪个端口转到SQL Server Network Configuration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM