Search code examples
sql-serverenvironment-variablessqlpackage

'sqlpackage.exe' is not recognized as an internal or external command Error


I used maven,Microsoft SQL server management studio 17.SQL server verion is 14.0.1000.169. When i build my project it gives following error and build failed

'sqlpackage.exe' is not recognized as an internal or external command,
operable program or batch file.
[ERROR] The following errors occured during execution:
[ERROR] 'sqlpackage.exe' is not recognized as an internal or external command,
[ERROR] operable program or batch file.

This is my system environment path variables. enter image description here

I can't find what's the wrong


Solution

  • It's fixed using following steps.

    this is because you haven't sqlpackage.exe in your Path variables. to fix this follow below steps.

    You need to Install Sql server data tools

    For windows,

    • Install chocolatey
    • Install SSDT components
    • Add sqlpackage.exe to classpath

    For Install chocolatey

    For Install SSDT components

    • choco install sqlserver-cmdlineutils

    • choco install sql2014.clrtypes

    • choco install sql2014-sqldom

    • choco install sql2014-dacframework

    For Add sqlpackage.exe to classpath

    • RUN setx PATH "%PATH%;C:\Program Files\Microsoft SQL Server\120\DAC\bin;"