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?
-
3Watching this presentation may help: channel9.msdn.com/posts/SQL11UPD03-REC-07Aaron Bertrand– Aaron Bertrand2012年03月11日 14:58:18 +00:00Commented Mar 11, 2012 at 14:58
-
4Have you considered using SQL Server CE? No standalone process, but almost identical functionality. Not sure if it would be of use in your case - but if so, it makes deployment a breeze (there isn't any)Basic– Basic2012年03月14日 16:38:42 +00:00Commented Mar 14, 2012 at 16:38
-
1Sorry, no support for stored procedure. I should explain. I see the LocalDB as a way to distribute a full functionally demo of my real application who requires a SQLServer with data-sharing. I wish to ship a CD or put a dowload on site without requiring the install of a SQLServer on the customer PCSteve– Steve2012年03月14日 16:48:24 +00:00Commented Mar 14, 2012 at 16:48
2 Answers 2
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 Framework, make sure to install .NET Framework 4.0.2 or newer, as mentioned here. The original .NET Framework 4 doesn't understand LocalDB connection strings, as it shipped long before LocalDB.
7 Comments
Note that you only have to install SQLLocalDB which is part of SQL Express software. You can directly download the SQLLocalDB file here - https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver16 and run it in client machine where you have your software.
Comments
Explore related questions
See similar questions with these tags.