BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News LocalDB: A Lightweight SQL Express for Developers

LocalDB: A Lightweight SQL Express for Developers

This item in japanese

As part of SQL Denali CTP3, Microsoft has included a new version of SQL Express called Local Database Runtime (LocalDB). It offers many of the same features as SQL Express, but installs faster, has fewer prerequisites, and doesn’t require management of a database instance.

LocalDB is meant to be an easier way for developers to get a SQL Express database up and running with minimal configuration or management, but it can also be used in production if it suits the needs of an application. Because it opens as a file with exclusive use, LocalDB is not appropriate for server-based or multi-user environments.

LocalDB fully supports T-SQL, and uses the same client-side providers as other versions of SQL Server (ADO.NET, ODBC, etc). It runs in-process, rather than as a service. When an application connects to LocalDB, the provider checks to see if it’s already running, and if not, will start it up and connect. The connection closes automatically after a few minutes of inactivity.

The database supports AttachDbFileName, so the connection to LocalDB is straightforward:

"Data Source=(localdb)\v11.0;IntegratedSecurity=true;AttachDbFileName=C:\MyData\Database1.mdf"

Microsoft states that they intend to provide a LocalDB download option in the future. For now, developers can demo it by downloading the SQL Denali Express CTP3 and selecting the LocalDB option during installation.

Rate this Article

Adoption
Style

BT