Search code examples
sql-serverconnection-stringsqldatasourcelocaldb

"Server" vs "Data Source" in connection string


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?


Solution

  • 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