Have you ever forgotten your SQL server instance name?

May 21, 20191 Min Read
Sometimes, when I open SQL Server Management Studio, I forget about my Local DB instance name. Here's how to retrieve it.

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 stand 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.

Hey, what do you think of this article?
Let me know on Twitter!

Of course, if you have suggestions on some topics you'd like to read about, just ask!