Code4IT

The place for .NET enthusiasts, Azure lovers, and backend developers

Retrieving your SQL LocalDB Instance Name: A How-To Guide

2019-05-21 1 min read Blog
Just a second!
If you are here, it means that you are a software developer. So, you know that storage, networking, and domain management have a cost .

If you want to support this blog, please ensure that you have disabled the adblocker for this site. I configured Google AdSense to show as few ADS as possible - I don't want to bother you with lots of ads, but I still need to add some to pay for the resources for my site.

Thank you for your understanding.
- Davide

This article is just a note for something I forget the most: my LocalDB instance names.

Sometimes when I open SQL Server Management Studio (SSMS) I lose time thinking and trying to figure out what is the name of my LocalDb.

The solution is simple: open the terminal and run SQLLocalDb.exe i, where i stands for information.

Now you can see the list of configured DBs.

SQLLocalDb.exe i result

To use it in SSMS remember to use Windows Authentication.

If you need more info about a specific instance, just run SQLLocalDB.exe i "InstanceName" where of course InstanceName must be replaced with the real name you are looking for.

This command displays some info about the specified SQL instance: this info includes the version, the owner and the current state.

SQL instance details

If you want to have a list of all available commands, run SQLLocalDB.exe -?. These commands allow you to create and delete SQL instances, stop and start existing instances and so on.

SQLLocalDB command options

It’s important to remember that here the spaces are treated as delimiters, so if your DB includes spaces inside its name, you must surround the name with quotes.

This article first appeared on Code4IT