Install SQLCMD on Windows using Chocolatey

You can install SQLCMD on Windows (for accessing Microsoft SQL Server databases, both locally and remotely).

choco install sqlserver-cmdlineutils

SQLCMD Install Log

If all is well you can expect Chocolatey to produce the below SQLCMD install log.

choco install sqlserver-cmdlineutils
Chocolatey v0.10.5
Installing the following packages:
sqlserver-cmdlineutils
By installing you accept licenses for the packages.
Progress: Downloading sqlserver-odbcdriver 13.1.4413.46… 100%
Progress: Downloading sqlserver-cmdlineutils 13.1… 100%

sqlserver-odbcdriver v13.1.4413.46 [Approved]
sqlserver-odbcdriver package files install completed. Performing other installation steps.
The package sqlserver-odbcdriver wants to run ‘chocolateyinstall.ps1′.
Note: If you don’t run this script, the installation will fail.
Note: To confirm automatically next time, use ‘-y’ or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[N]o/[P]rint): Y

Downloading sqlserver-odbcdriver 64 bit
from ‘https://download.microsoft.com/download/D/5/E/D5EEF288-A277-45C8-855B-8E2CB7E25B96/x64/msodbcsql.msi’
Progress: 100% – Completed download of C:\Users\apollo\AppData\Local\Temp\chocolatey\sqlserver-odbcdriver\13.1.4413.46\msodbcsql.msi (4.12 MB).
Download of msodbcsql.msi (4.12 MB) completed.
Installing sqlserver-odbcdriver…
sqlserver-odbcdriver has been installed.
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
The install of sqlserver-odbcdriver was successful.
Software installed as ‘msi’, install location is likely default.

sqlserver-cmdlineutils v13.1 [Approved]
sqlserver-cmdlineutils package files install completed. Performing other installation steps.
The package sqlserver-cmdlineutils wants to run ‘chocolateyinstall.ps1′.
Note: If you don’t run this script, the installation will fail.
Note: To confirm automatically next time, use ‘-y’ or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[N]o/[P]rint): Y

Downloading sqlserver-cmdlineutils 64 bit
from ‘https://download.microsoft.com/download/C/8/8/C88C2E51-8D23-4301-9F4B-64C8E2F163C5/Command%20Line%20Utilities%20MSI%20files/amd64/MsSqlCmdLnUtils.msi’
Progress: 100% – Completed download of C:\Users\apollo\AppData\Local\Temp\chocolatey\sqlserver-cmdlineutils\13.1\MsSqlCmdLnUtils.msi (2.65 MB).
Download of MsSqlCmdLnUtils.msi (2.65 MB) completed.
Installing sqlserver-cmdlineutils…
sqlserver-cmdlineutils has been installed.
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
The install of sqlserver-cmdlineutils was successful.
Software installed as ‘msi’, install location is likely default.

Chocolatey installed 2/2 packages. 0 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Leave a Reply

Your email address will not be published. Required fields are marked *