2

I have two instances of SQL Server 2008 Express and one instance of SQL Server 2012 on my development machine. We're developing an ASP.NET MVC application and use the expression data source=(local); inside of our connectionString in Web.config.

Now my question is what is the logic behind this expression? Which instance gets chosen and how can I change this behavior?

0

4 Answers 4

2

Using "local" you get the default instance which is usually the non-express SQL Server since by default in SQL Server Express installation the instance name is "SQLEXPRESS" and in full SQL Server installation by default you don't get an instance name unless you set it explicitly.

Sign up to request clarification or add additional context in comments.

Comments

1

(local) just means means to use the SQL Server installed in the current Machine
Any of the following three

  • "(local)" ,
  • "." ,
  • ".\\SQLEXPRESS"

can be used to make use of the SQL Server installed in the current Machine.

Comments

0

Every instance has instance name, so you can specify source=(local)\INSTANCE_NAME.

You can check instance's and their names in sql server configuration manager.

Comments

0

When you use data source="(local)"; It means it connects to SQL Server database on the local server

You can find more at microsoft references :
http://technet.microsoft.com/en-us/library/ms156450(v=sql.100).aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.