sqlcmd 不是 运行

sqlcmd not running

我不是 SQL 专家,但我确实需要使用 sqlcmd 实用程序。

我已经安装了

但是当我 运行 sqlcmd 时,我得到

C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn>sqlcmd

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2].

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or instance-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 if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

你能帮忙吗?

我确实需要将 .mdf 文件附加到我的 SQL Server 2012 计算机

可能是您遗漏了实例名称 - 用法:
sqlcmd -S <ComputerName>\<InstanceName>