Click here to Skip to main content
15,909,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been using SqlLocalDB 2016 (version 13.0) for a while, and it is working fine except the utility SqlLocalDB.exe does not work properly - when I execute the following command  it returns errors:
C:\Program Files\Microsoft SQL Server\130\Tools\Binn>SqlLocalDB i "MSSQLLocalDB"
FormatMessageW failed. Error code returned: 15100
FormatMessageW failed. Error code returned: 15105
FormatMessageW failed. Error code returned: 15105
FormatMessageW failed. Error code returned: 15105
FormatMessageW failed. Error code returned: 15105

I installed SqlLocalDB 2017 (version 14.0), and when I run the same command from the directory where the new SqlLocalDB.exe is installed it runs correctly:
C:\Program Files\Microsoft SQL Server\140\Tools\Binn>SqlLocalDB i "MSSQLLocalDB"
Name:               MSSQLLocalDB
Version:            13.2.5102.14
Shared name:
Owner:              Vics_PC\Victor
Auto-create:        Yes
State:              Stopped
Last start time:    9/12/2020 10:24:38 AM
Instance pipe name:

However, when I run SqlLocalDB.exe from any other directory, for instance the debug directory where my code is running, I get the errors. 
So it seems Windows is running the 2016 version of the utility, not the 2017 version.

I can see references to three versions of SqlLocalDB.exe in the Windows Registry, V12, V13, V14. How do I get Windows to run the latest version?


What I have tried:

I have tried running SqlLocalDB.exe (V14) from it's installed directory and it works, but Windows runs the older version (V13) from any other directory.
Posted
Updated 13-Sep-20 5:12am

1 solution

 
Share this answer
 
Comments
Member 11298827 13-Sep-20 18:59pm    
Gerry, thanks for this thought.
I looked at the System PATH variable and saw the three different paths, one each for V12, V13, and V14.
Using the "Move Down" button I put them in the correct order (V14, V13, V12) so V14 would be found first.
This works great, thanks for the tip.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900