0

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
JukEboX
  • 815
  • 4
  • 17
  • 46
  • 1
    What you have installed is not the classic sqlcmd: https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15 – Manu Aug 06 '21 at 13:34
  • @Manu So should I remove that and reinstall the one in your link? Because I have both of them. – JukEboX Aug 06 '21 at 13:44
  • 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/ – Manu Aug 06 '21 at 13:56
  • @Manu I have iinstalled the V15 tools from the Microsoft website but I still don't get anything from SQLCMD command. – JukEboX Aug 06 '21 at 14:40
  • 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" – Manu Aug 06 '21 at 14:53
  • @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 :/ – JukEboX Aug 09 '21 at 11:50
  • 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. – Manu Aug 09 '21 at 15:11
  • @Manu is that with the Express version? I am running 2019 Express. – JukEboX Aug 09 '21 at 17:53
  • I've used Standard version. Am pretty sure sqlcmd is also included in Express. Have you tried the repair? – Manu Aug 10 '21 at 07:36
  • @Manu I reinstalled SMSS 18.9.2 and SQL and still nothing. – JukEboX Aug 11 '21 at 12:59

0 Answers0