"Server" vs "Data Source" in connection string

nawfal picture nawfal · Feb 22, 2013 · Viewed 43.4k times · Source

I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works:

Data Source=(localdb)\v11.0;Integrated Security=true;

and

Server=(localdb)\v11.0;Integrated Security=true;

What exact difference is there between the two?

Answer

Damien_The_Unbeliever picture Damien_The_Unbeliever · Feb 22, 2013

For the full list of all of the connection string keywords, including those that are entirely synonymous, please refer to the SqlConnection.ConnectionString documentation:

These are all entirely equivalent:

  • Data Source
  • Server
  • Address
  • Addr
  • Network Address