sql-serverlocaldb

How do I make and access shared instances of a LocalDB instance?


I installed the LocalDB component (only) from SQL Server 2019 Express on a Windows 10 machine that had NO Sql Server installation of any kind. I installed SSMS next.

The AUTOMATIC instance MSSQLLOCALDB works as advertised. I can use SSMS to access it, add a database, perform queries, everything is fine.

I want to make this instance shared.

So I typed (from Powershell) sqllocaldb share MSSQLLOCALDB SharedDb

The shared instance is properly created.

PS C:\WINDOWS\system32> sqllocaldb i
.\SharedDb

MSSQLLocalDB

But I cannot access the shared instance from SSMS

Things I have tried

Fails with: Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. . Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired. Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

Any suggestions on how to share a LocalDB instance would be appreciated. Thanks.


Solution

  • There is a known bug in SQL Server Version 2017 and newer that breaks the use of Shared Instance. Currently the only Option is to downgrade to SQL Server Version 2016.

    Please Upvote this Issues on the SQl Feedback Forum, hopfuly they will fix it eventually.

    For an detailed explanation of the problem view the answer on this Post