Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql server express connection string

Is there a difference between sql server connection string and the express vesion?!

like image 814
jDeveloper Avatar asked Aug 07 '09 20:08

jDeveloper


2 Answers

By default (though I don't recommend it1), Sql Express is installed as a named instance. That means you must connect like Server=servername.com\SQLEXPRESS as opposed to just Server=servername.com.

As always, connectionstrings.com has the goodies.

1 I don't recommend named instances because they run on a different port, which makes firewalling a PITA. Also, it makes little sense to me to run more than 1 MSSQL Server on a computer when you could just host multiple databases instead - so I'm not really sure what the point is.

like image 170
Mark Brackett Avatar answered Oct 16 '22 01:10

Mark Brackett


Yes there is a difference- the big one being you won't have AttachDbFilename in the full SQL Server.

SQL Server Express connection string:

Server=.\SQLExpress;AttachDbFilename=c:\mydbfile.mdf;Database=dbname; Trusted_Connection=Yes;

Typical normal SQL Server connection string:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

See connectionStrings.com for more info.

like image 28
RichardOD Avatar answered Oct 15 '22 23:10

RichardOD