DEV Community

Cover image for Have you ever forgotten your SQL server instance name?
Davide Bellone
Davide Bellone

Posted on • Originally published at code4it.dev on

Have you ever forgotten your SQL server instance name?

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 your real name you are looking for.

This command displays some info about the specified SQL instance: this info include 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.

Top comments (0)