2

I have three SQL server instances on my computer. How can I find out which is the default one?

var conn = new SqlConnection("Data Source=.;Initial Catalog=SampleDb;Integrated Security=True")

I want to learn when I use '.' as above which database I will use.

1
  • 1
    The "." indicates the default local instance. Local named instances can be accessed by specifying ".\<instance-name>". The default instance may be accessed locally or remotely using "<host-name-or-ip-address>". Named instances can be accessed locally or remotely using "<host-name-or-ip-address>\<instance-name>" or "<host-name-or-ip-address>,<port-number>" specifications. Commented Jul 20, 2014 at 15:11

1 Answer 1

2

You can only have more than one instance per OS installation if all of them have different instance names. The data source property has the format

HOST\INSTANCENAME

You are connecting to the default instance (of which there can only be one).

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

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.