1

I'm trying to understanding LocalDB by reading MSDN: SQL Server 2016 Express LocalDB and MSDN: SQL Server Express LocalDB and SQL Server Express and a number of SO posts including confusion about SQL Server Express and localdb, I still cannot understand what is LocalDB. I understand and have used SQL Server Express and SQL Server CE.

Questions:

LocalDB...the necessary SQL Server infrastructure is automatically created and started

My understanding is that, if using LocalDB to handle an application's database, neither the developer nor the client machine where the application is deployed needs to install the heavy SQL Server Express, but just need to install the lighter LocalDB. How, then, without SQL Server Express install can localDB "create(d) and start(ed)" SQL Server? If localDB

... once installed, LocalDB is an instance of SQL Server Express that can create and open SQL Server databases. The system database files for the database are stored in the users' local AppData path which is normally hidden.

If developer or client can use localDB without installing SQL Server, how can localDB be an instance of something that is not installed? Or is localDB an incomplete version of SQL Server Express that just does not need to click..click..click.. to configure. Essentially localDB works like SQL Server CE where localDB use some hidden "files" in AppData to create database while SQL Server CE use the dll to generate the database?

SqlLocalDB.msi program to install the necessary files on the computer

If client still needs to install localDB (which is not really portable along with the application like SQL Server CE), then why not just install SQL Server Express? Either localDB or SQL Server Express is above 100MB+ anyway and need separate installation, what is the point of using localDB anyway?

Community
  • 1
  • 1
KMC
  • 19,548
  • 58
  • 164
  • 253

2 Answers2

1

We used localdb on a project where we had agents in the field using laptops.

  1. The functionality of localdb was better than SQL Server CE (I don't remember exactly what CE was missing, but it was important to the project), you should review the functional differences.

  2. Another advantage was the db was stored in the user folder which makes it impossible for other non-admin users of the laptop to see. This allowed us to reuse and even share laptops between users without mixing data - a nice feature.

  3. Finally, the dbs (with a little effort) can be copied to the dev/support side and restored/attached for troubleshooting. They are full .mdf/.ldf database files.

You do have to create the instances using a command line (sqllocaldb utility), after the product is installed. This was just part of our install app.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
paulbarbin
  • 382
  • 2
  • 9
1

LocalDB is a programmer-oriented version of SQL Server Express that needs to be installed just like SQL Server Express.

Unlike SQL Server Express, it's not installed as a Windows Service that starts up with your Windows OS - but it only starts up as needed (when your application starts up, or when you start it manually with the SqlLocalDb command line tool).

But LocalDB IS SQL Server Express (not Compact Edition). It uses the same .mdf and .ldf database files like and desktop/server version of SQL Server, not SQL Server CE's .sdf file format.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459