question

ArcherVic avatar image
ArcherVic asked

How do I change the default instance of LocalDB

I have a Windows Form project in VS2015 that uses a local database file (.MDF). Currently I have SQL Server Express 2016 installed, including 2016 LocalDB. 2014 LocalDB is also installed. The default instance for LocalDB (instance name = MSSQLLocalDB) is 12.0 (2014 version), but I need it to be 13.0 (2016 version).

I have tried using the command line utility SqlLocalDB.exe to delete and then create the MSSQLLocalDB instance, but it does not work, I just get the errors shown below.

C:\Program Files\Microsoft SQL Server\130\LocalDB\Binn>SqlLocalDB.exe delete "MSSQLLocalDB" FormatMessageW failed. Error code returned: 15100

C:\Program Files\Microsoft SQL Server\130\LocalDB\Binn>SqlLocalDB.exe create "MSSQLLocalDB" FormatMessageW failed. Error code returned: 15100

How do I change the default instance to 13.0? Do I need to uninstall 2014 LocalDB?

sql serverdefault
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ArcherVic avatar image
ArcherVic answered

I could not get SqlLocalDB.exe to work. However, I went into "Programs and Features" and selected Sql Server 2016 LocalDB and did a "Repair". That seems to have changed the default to 2016 version. Wish I understood why that worked.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.