sql-serversql-server-2012localdb

What are the benefits of named instances in SQL Server?


What is the benefit of creating a named instance in SqlLocalDB instead of using the default v11.0 instance? In my scenario I am attaching a database file using AttachDbFileName option in connection string.

A helper question: is it possible to have different settings for different LocalDB instances? If so, what kind of settings (I read that you cannot change eg. collation)?


Solution

  • I can see two possible benefits, performance and ability to control your configuration.

    LocalDB is limited the same way as other SQL Express instances, CPU and RAM limits are applied per-instance. If your application uses its own instance it will get it all for itself and won't need to share with other applications. Using default instance means your application has to share with other apps using default instance.

    You might also use named instance if you need to make any special instance-wide configuration that might break other applications. Or if you're concerned that some other misbehaving application might make changes to the default instance that break your application, and have your customers blame you. Works both ways :-)