confusion about SQL Server Express and localdb
Asked Answered
C

1

22

I need to deploy a WCF service with a database on client machines. I am confused about SQL Server Express. I need to verify all of the following.

When attaching database files in the App_Data folder, do I still need to install SQL Server Express engine (Windows service) on client machines?

There is a flavor called SQL Server Express LocalDb. That one does not need an engine (Windows service)? But I think it need a prerequisite installation of LocalDb.

Localdb is introduced with SQL Server 2012. There is NO localdb for SQL Server 2008. Correct? I could not find 2008 version on MS site.

Christine answered 9/7, 2013 at 12:19 Comment(1)
You are right, SQL Server LoclalDB was introduced with version 2012.Accurate
T
16

Do I still need to install SQL Server Express engine (A win Service) on client machines?

Yes, they need it installed for your application to query the database. Can't really get around it.

There is a flavor called SQL Express localDb. That one does not need an engine (win service)? but I think it need a perquisite installation of localdb.

Yes, you'd still need to install LocalDB on the client machine. It's pretty hassle-free to do, but I think it's overkill unless you really need the full features of a SQL Server instance for your webservice.

Instead of LocalDB I'd strongly recommend using SQL Server Compact Edition - it performs the role you're thinking of (your WCF Service can simply connect directly to the database file on your client machines without installing SQL Server, and is lightweight), but doesn't need to be installed (it's simply included as a DLL with your WCF application):

Unlike other editions of Microsoft SQL Server, SQL CE runs in-process with the application which is hosting it.

In Microsoft's own words on the differences between LocalDB and SQLCE:

LocalDB and SQL Server Compact?

Small and simple database, lightweight installation, connecting to a database file -- this will sound familiar to any developer using SQL Server Compact. The similarities are not accidental, as our goal for LocalDB was to be as easy to use as SQL Server Compact (while being as powerful and compatible with full SQL Server as SQL Express).

There are significant differences between LocalDB and SQL Server Compact:

Execution mode: SQL Server Compact is an in-proc DLL, while LocalDB runs as a separate process.

SQL Server CE is kind of like an updated version of MS Access, the file goes with the application which can "just connect" to the database file without involving any database server installation, and its syntax/features are very close to SQL Server standard.

Tsar answered 9/7, 2013 at 12:41 Comment(3)
I can't get why a developer will need to put a database file in App_Data folder?Christine
Because that's the explicit purpose of the App_Data folder in Visual Studio projects - a non-web accessible location for your application to store local files it needs (in this case a database file).Tsar
I'm pretty sure SQL Server Compact Edition has been deprecated btw. See discussion from first link and more detail about the difference btw the different versions in the second link. #20363874 blogs.msdn.microsoft.com/sqlexpress/2011/07/12/…Catherin

© 2022 - 2024 — McMap. All rights reserved.