Reputation: 41
I'm trying to work on a version problem with LocalDB. The command "sqllocaldb i" seems to work.
C:\WINDOWS\system32>sqllocaldb i
MSSQLLocalDB
ProjectsV12
But, when I ask for something specific, I get only errors. (I'm on Windows 10)
C:\WINDOWS\system32>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
Upvotes: 2
Views: 4409
Reputation: 1503
Rather than re-installing as identified by @Paul, I found the resolution was to look at the system environment variable "Path" and I moved the paths associated with the latest version of SQLserver to be first in the list rather than later in the list.
You can verify the order using:
where.exe sqllocaldb
C:\Program Files\Microsoft SQL Server\150\Tools\Binn\SqlLocalDB.exe
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\SqlLocalDB.exe
Hope this saves someone some grief!
Upvotes: 0
Reputation: 428
I fixed this by removing all traces of SQL from my machine and re-installing only what I needed (2016 in my case). Basically, search for "SQL" in Control Panel and remove whatever shows up.
I think this has to do with having multiple versions installed, and/or corruption happening when you update them, because:
UPDATE: it looks like the fix for this is closer to: re-install 2016 and install the 2017 sqllocaldb
- no need to clean up other versions as I did. See Victor's subsequent post as well as my comment there.
Upvotes: 0
Reputation: 41
Thanks for the reply Paul. I have also removed all older SQL installs, but to get information on a particular LocalDB server instance using the SqlLocalDB.exe utility, I had to install the 2017 version. For instance I can now get information on an instance of SQLLocalDB (2016 version) that I created and called 'TAS_LocalDB_V13' using the command -
SqlLocalDB i TAS_LocalDB_V13
But, since there are now two versions of SQLLocalDB installed, there are two executables named SqlLocalDB.exe. The one that will run depends on the system environment path variable. I had to edit the path variable so that the path to SqlLocalDB.exe appearing first in the list was the 2017 version (which works).
Note - even though the i command in 2016 version does not work, other important commands like 'c' to create a server instance do work.
Upvotes: 1