Search code examples
sql-server-2012sqlcmd

sqlcmd not running


I am not a SQL specialist, but I really need to use the sqlcmd utility.

I have installed

enter image description here

but when I run sqlcmd, I get

C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\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..

Can you give a help hand please ?

I really need to attach a .mdf file to my SQL Server 2012 machine


Solution

  • May be you are missing the instance name - usage:
    sqlcmd -S <ComputerName>\<InstanceName>