SQL Server 2012: PC-NAME \ SQLEXPRESS login works, but not locally / (locally)

I would like to log into my SQL Server 2012 Express with the server name local or (local) , but it does not work.

The only server name that works is PC-Name\SQLEXPRESS .

local/(local) should work somehow because I have to use the following connection string:

 Data Source=localhost;Initial Catalog=... 
+2
source share
2 answers

I reinstalled it and during the installation process will select "default instance" instead of "named instance". Now all is well.

+3
source

I think that now I see what you are trying to do.

If you really don't like to use the hostname \ instance combination and you use your own SQL client to connect, you can always add an alias to your own client, called local, which resolves your instance. This way, you can save your connection string in your application the same way no matter which server / instance you end up inserting into the application, simply by changing the alias.

See the link below for more details on customization:

How to configure and use a SQL Server alias

+1
source

All Articles