Score:0

SQLCMD CMD Line Tools Fails install

cn flag

I recently installed the most recent version of SQL CMD Line Tools.

I installed it using these directions.

I ran the following command to make sure the module is installed:

Get-Module -ListAvailable -Name sqlserver

Which returns the sqlserver module in all locations version 21.1.18080.

When I run the following command sqlcmd /? or -? I don't get an error but I don't get any output. Is there more that needs to be done to show the usage in powershell when I input sqlcmd /? ?

Environment:

  • Microsoft Windows Server 2019 Standard 64-Bit
  • Microsoft SQL Server 2019 Express Edition
  • Microsoft SQL Powershell CMD Line Utilties V21.1.18080
  • Microsoft SQL CMD Line Utilties V15 64Bit & 86Bit
Manu avatar
us flag
What you have installed is not the classic sqlcmd: https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15
cn flag
@Manu So should I remove that and reinstall the one in your link? Because I have both of them.
Manu avatar
us flag
Well, depends on what you want to do. If you just want to run some sql statements in cmd, sqlcmd is the way to go. I've never used the tools you have posted and don't know what they are for. If you want something more "out of the box", have a look here: https://dbatools.io/
cn flag
@Manu I have iinstalled the V15 tools from the Microsoft website but I still don't get anything from SQLCMD command.
Manu avatar
us flag
interesting, try to locate the sqlcmd.exe. Mine is here: C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn Since you have SQL Server installed, you should already have sqlcmd since it is part of the SQL Server installation but it might be some optional shared features. So you could try to install it via SQL Server Setup and "add shared feature"
cn flag
@Manu I have SQL 2019 Express installed and I don't see sqlcmd.exe anywhere. I installed the CMD LINE Tools per this link https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15 but still don't have it anywhere :/
Manu avatar
us flag
Ok, in order to find out which feature sqlcmd is part of the SQL Server installation, I've deleted my sqlcmd.exe on one of my testservers and run the repair for shared features first and for one of the instances next. The sqlcmd.exe was only "repaird" by running the repair of the default instance. So, you could mount the Installation iso and run the repair of your default instance.
cn flag
@Manu is that with the Express version? I am running 2019 Express.
Manu avatar
us flag
I've used Standard version. Am pretty sure sqlcmd is also included in Express. Have you tried the repair?
cn flag
@Manu I reinstalled SMSS 18.9.2 and SQL and still nothing.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.