I have two versions (2012, 2014) of SQL Server Express LocalDB installed in my system.
How can I find all existing LocalDB
instance names?
I found a way to do that using command line as mentioned in the answers section.
Is there a better and easy way to do it?
To list all the SQL instances, navigate to the root directory and run the Get-Childitem to get the list. Note: The path SQLSERVER:\SQL\<ServerName> has all the installed SQL instances of the listed server.
An instance of SQL Server Express LocalDB is an instance created by a user for their use. Any user on the computer can create a database using an instance of LocalDB, store files under their user profile, and run the process under their credentials. By default, access to the instance of LocalDB is limited to its owner.
I found SqlLocalDB utility that needs to be run on command line.
SqlLocalDB can be found in
C:\Program Files\Microsoft SQL Server\110\Tools\Binn
or
C:\Program Files\Microsoft SQL Server\120\Tools\Binn
To get all existing LocalDB
instance names, use:
SqlLocalDB.exe i info|i Lists all existing LocalDB instances owned by the current user and all shared LocalDB instances.
To get detailed information about a specific LocalDB
instance:
SqlLocalDB.exe i "MSSQLLocalDB" info|i "instance name" Prints the information about the specified LocalDB instance.
To list all localdb instances
, take a look vineel's answer below!
If you want to list all databases
of your default localdb
instance using UI, look here (might not work with SSMS2019 anymore):
Just open your SSMS and connect to (LocalDB)\MSSQLLocalDB
.
Now you will see all your LocalDB-Instances.
This works at least with SS2016.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With