5

On a machine with SQL Server LocalDB 2014 installed I am looking for SQLCMD.EXE file but cannot find it anywhere. Is there a way how to install it separately?

Unfortunately I am not local admin of the machine, so I prefer no MSI...

Found this link https://www.microsoft.com/en-us/download/confirmation.aspx?id=36433, but cannot use MSI... Perhaps copying executable files and dlls can do the trick.

After copying files SQLCMD.EXE, BATCHPARSER.DLL and SQLCMD.RLL from C:\Program Files\Microsoft SQL Server\110\Tools\Binn from another computer with SSMS installed I still get the error:

Microsoft SQL Server Native Client 11.0 : Data source name not found and no default driver specified.

running sqlcmd -S np:\\.\pipe\LOCALDB#F8040C8F\tsql\query.

Hannah Vernon
  • 70,041
  • 22
  • 171
  • 315
Vojtěch Dohnal
  • 619
  • 1
  • 11
  • 23
  • http://dba.stackexchange.com/questions/71949/where-is-sqlcmd-exe-in-sql-server-2014-express – Md Haidar Ali Khan Apr 23 '15 at 08:31
  • Not applicable for LocalDB. – Vojtěch Dohnal Apr 23 '15 at 08:32
  • 4
    Unfortunately you'll probably need the MSI http://www.microsoft.com/en-gb/download/details.aspx?id=36433 Otherwise, as with 2012, I would think you can go through the Installation Wizard http://www.mssqltips.com/sqlservertip/2694/getting-started-with-sql-server-2012-express-localdb/ – Mark Sinkinson Apr 23 '15 at 08:37
  • @VojtěchDohnal I think your ServerName is incorrect. I am able to connect (also using Native Client 11.0) via the following: sqlcmd -S (localdb)\Projects -Q "SELECT DB_NAME(), @@SERVERNAME;". Essentially, unless something else is missing, LocalDB connections (as of .NET Framework v 4.5, I believe) are made using "(localdb){InstanceName}". If that works, I will add it as an answer. – Solomon Rutzky Apr 23 '15 at 16:03

2 Answers2

5

I have figured out that during SQL Server LocalDB MSI installation the ODBC driver is not installed

So to use SQLCMD it is necessary to install Microsoft® ODBC Driver 11 for SQL Server® - it is a part of ODBC driver as per here.

When I tried to install Microsoft® Command Line Utilities 11 for SQL Server® it prompted me to install the ODBC Driver first.

Then it is possible either to copy the files SQLCMD.EXE, BATCHPARSER.DLL and SQLCMD.RLL or to install Microsoft® Command Line Utilities 11 for SQL Server®.

Vojtěch Dohnal
  • 619
  • 1
  • 11
  • 23
0

Are you installing SQL Server 2014 on a Windows installation with no previous version of SQL Server in?

Have a look at C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn