Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LocalDB deployment on client PC

I am very intrigued by this new version of SQL Server Express.

It's not clear (to me) what a setup program should do to deploy an application that use a LocalDB.

Is it required to install SQL Server Express on the client PC and then attach the MDF file?

Or it's only required to run the LocalDB.msi and it works as a standalone file like SQL Server Compact?

like image 659
Steve Avatar asked Mar 11 '12 13:03

Steve


People also ask

Can I use LocalDB in production?

LocalDB is absolutely supported in production. From the performance point of view it is identical to SQL Server Express, as they share the same database engine.

How do I connect to my LocalDB instance?

You can connect with MSSMS to LocalDB. Type only in SERVER NAME: (localdb)\v11. 0 and leave it by Windows Authentication and it connects to your LocalDB server and shows you the databases in it.

Where is LocalDB installed?

User database files are stored where the user designates, typically somewhere in the C:\Users\<user>\Documents\ folder. For more information about including LocalDB in an application, see Visual Studio Local Data Overview, Create a database and add tables in Visual Studio.


1 Answers

You don't need to install SQL Server Express to use LocalDB, as LocalDB is SQL Server Express, just easier to install.

Once LocalDB is installed you can use AttachDbFileName property of the connection string to "open" an MDF file. Keep in mind that the same file can only be opened by a single LocalDB instance (single Windows login) at any given time, so this is not a data-sharing feature.

Update: If your application is using .NET, make sure to install .NET 4.0.2 or newer, as mentioned here. The original .NET 4 doesn't understand LocalDB connection strings, as it shipped long before LocalDB.

like image 113
Krzysztof Kozielczyk Avatar answered Nov 08 '22 18:11

Krzysztof Kozielczyk