Microsoft SQL Server Compact (EOL, See SQL Express) (SQL CE) is a
compact
Compact as used in politics may refer broadly to a pact or treaty; in more specific cases it may refer to:
* Interstate compact
* Blood compact, an ancient ritual of the Philippines
* Compact government, a type of colonial rule utilized in British ...
relational database
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
produced by
Microsoft
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
for applications that run on mobile devices and desktops. Prior to the introduction of the desktop platform, it was known as ''SQL Server for
Windows CE
Windows Embedded Compact, formerly Windows Embedded CE, Windows Powered and Windows CE, is an operating system subfamily developed by Microsoft as part of its Windows Embedded family of products.
Unlike Windows Embedded Standard, which is ba ...
'' and ''SQL Server Mobile Edition''.
It includes both 32-bit and 64-bit native support.
[ SQL CE targets occasionally connected applications and applications with an embedded database.] It is free to download and redistribute.[ An ]ODBC
In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. A ...
driver for SQL CE does not exist, nor is one planned. Native applications may use SQL CE via OLE DB.
The latest, and last, release is the SQL Server Compact 4.0. In February 2013 SQL Server Compact Edition had been deprecated; no new versions or updates are planned, although Microsoft continued to support the product until July 2021.[
]
Overview
SQL Server Compact shares a common API with the other Microsoft SQL Server
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
editions. It also includes ADO.NET providers for data access using ADO.NET APIs, and built-in synchronization capabilities,[ as well as support for LINQ and Entity Framework. Future releases will unify the synchronization capabilities with ]Microsoft Synchronization Services
Microsoft Sync Framework is a data synchronization platform from Microsoft that can be used to synchronize data across multiple data stores. Sync Framework includes a transport-agnostic architecture, into which data store-specific synchronizatio ...
. Unlike other editions of Microsoft SQL Server
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
, SQL CE runs in-process[ with the application which is hosting it. It has a disk footprint of less than 2 MB and a memory footprint of approximately 5 MB.][ SQL CE is optimized for an architecture where all applications share the same memory pool.]
Windows Store app
Universal Windows Platform (UWP) apps (formerly Windows Store apps and Metro-style apps) are applications that can be used across all compatible Microsoft Windows devices, including personal computers (PCs), tablets, smartphones, Xbox One, Mic ...
s for Windows 8 cannot use SQL Server Compact edition, or any other edition of SQL Server.
Support
SQL CE databases can support ACID-compliance, but do not meet the durability requirement by default because AutoFlush buffers changes in memory (including enlisted ambient transactions and explicit SQL CE transactions that do not override the Commit() call with an CommitMode.Immediate value). Therefore, committed transaction changes can be lost. To meet the durability requirement the commit call on the transaction must specify the immediate flag. Like Microsoft SQL Server
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
, SQL CE supports transactions, referential integrity constraints, locking as well as multiple connections to the database store.[ However, nested transactions are not supported, even though parallel transactions (on different tables) are. The current release does not support ]stored procedures
A stored procedure (also termed proc, storp, sproc, StoPro, StoredProc, StoreProc, sp, or SP) is a subroutine available to applications that access a relational database management system (RDBMS). Such procedures are stored in the database data dic ...
[ or native ]XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. ...
data type either.[ It uses a subset of ]T-SQL
Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to the SQL (Structured Query Language) used to interact with relational databases. T-SQL expands on the SQL standard to include procedural programming, local variables, vari ...
[ for querying and due to lack of XML support, XQuery is not supported either.][ Queries are processed by an optimizing query processor.] SQL CE databases also support indexing, as well as support remote data replication (local caching of data in remote databases) and merge replication (bidirectional synchronization with master databases).
SQL CE databases can be created and managed from Microsoft Visual Studio
Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platfor ...
and some older versions of SQL Server Management Studio
Microsoft SQL Server Management Studio (SSMS) is a software application developed by Microsoft that is used for configuring, managing, and administering all components within Microsoft SQL Server. First launched with Microsoft SQL Server 200 ...
as well.[
]
File format
SQL CE databases reside in a single ''.sdf'' file, which can be up to 4 GB in size.[ The ''.sdf'' file can be encrypted with 128-bit ]encryption
In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can dec ...
for data security.[ SQL CE runtime mediates concurrent multi-user access to the ''.sdf'' file. The ''.sdf'' file can simply be copied to the destination system for deployment, or be deployed through ]ClickOnce
ClickOnce is a component of Microsoft .NET Framework 2.0 and later, and supports deploying applications made with Windows Forms or Windows Presentation Foundation. It is similar to Java Web Start for the Java Platform or Zero Install for Linux.
...
. SQL CE runtime has support for DataDirectories.[ Applications using an SQL CE database need not specify the entire path to an ''.sdf'' file in the ADO.NET connection string, rather it can be specified as '', DataDirectory, \.sdf'', defining the data directory (where the ''.sdf'' database file resides) being defined in the assembly manifest for the application.
SQL Server Management Studio 2005 can read and modify CE 3.0 and 3.1 database files (with the latest service pack), but SQL Server Management Studio 2008 (or later) is required to read version 3.5 files. Microsoft Visual Studio Express 2008 SP1 can create, modify, and query CE 3.5 SP1 database files. SQL Server Management Studio cannot read CE 4.0 files. Visual Studio 2010 SP1 can handle CE 4.0 database files.
The .sdf ("Sqlce Database File") naming convention is optional, and any extension can be used.
Setting a password for the database file is optional. The database can be compressed and repaired with the option of the compacted/repaired database to be placed into a new database file.
]
Deprecation
In February 2013, Microsoft announced that SQL Server Compact Edition had been deprecated.
Although no new versions or updates are planned, Microsoft will continue to support SQL Compact through their standard lifecycle support policy. Extended support for SQL Server Compact 4.0 ended on July 13, 2021.
See also
*Mobile database Mobile computing devices (e.g., smartphones and PDAs) store and share data over a mobile network, or a database which is actually stored by the mobile device. This could be a list of contacts, price information, distance travelled, or any other inf ...
*SQLite
SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the mo ...
*
*Access Database Engine
The Access Database Engine (also Office Access Connectivity Engine or ACE and formerly Microsoft Jet Database Engine, ''Microsoft JET Engine'' or simply ''Jet'') is a database engine on which several Microsoft products have been built. The firs ...
(ACE and formerly JET)
*HSQLDB
HSQLDB (''Hyper SQL Database'') is a relational database management system written in Java. It has a JDBC driver and supports a large subset of SQL-92, SQL:2008, SQL:2011, and SQL:2016 standards. It offers a fast, small (around 1300 kilobyt ...
* Firebird
References
External links
SQL Server Compact 3.5
SQL Server Compact Release Versions
Microsoft's Embedded Database - SQL Server Compact - Team Blog
{{Microsoft development tools
Microsoft server technology
Windows Mobile
Relational database management systems
Microsoft database software
Discontinued Microsoft software
fr:Microsoft SQL Server#Compact Edition
ja:Microsoft SQL Server#MSDE