How to resolve "sqlcmd is not recognized as an internal or external command..." when setting up a Spotfire Server database on SQL Server

How to resolve "sqlcmd is not recognized as an internal or external command..." when setting up a Spotfire Server database on SQL Server

book

Article ID: KB0138062

calendar_today

Updated On:

Products Versions
Spotfire Server 14.6

Description

When running the create_databases.bat script for SQL Server, located in the scripts>>mssql_install subfolder, if the sqlcmd is not installed, the following message will appear:

 

image.png

 

Note:  The above was encountered when running the create_databases.bat script via command line and entering the requirements one line at a time.

 

 

Environment

OS:  Windows

Resolution

One method is to install sqlcmd.exe is to use chocolatey.   Chocolatey is a open source package manager for Windows.  For details, seehttps://chocolatey.org/about

Some of the steps below are taken from here https://chocolatey.org/install

 

 

1.  Open an admin PowerShell window:

image.png

 

2.  Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.

image.png

 

3.  Run the following command:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

image.png

4.  Run the following command:  choco install sqlcmd

image.png

 

Key in Y to install:

image.png

Once successfully installed, run the create_databases.bat  again to create the schema and schema owner.  

Issue/Introduction

When using SQL Server as the database for Spotfire Server, if sqlcmd is not installed, a message of "sqlcmd is not recognized as an internal or external command..." and the set up will fail.

 

and the a How to use Chocolately package manager to install sqlcmd (a prerequisite to installing a Spotfire Server database in SQL)

Additional Information

See page 7 of the Spotfire Server quick start guide:  https://docs.tibco.com/pub/spotfire_server/14.6.0/doc/pdf/SPOT_sfire_server_14.6.0_quickstartguide.pdf?id=1 

Installing sqlcmd.exe https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-download-install?view=sql-server-ver17&tabs=windows