HOME

TheInfoList



OR:

Microsoft SQL Server Compact (SQL CE) is a discontinued
relational database A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970. A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured for ...
produced by
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
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 CE, later known as Windows Embedded CE and Windows Embedded Compact, is a discontinued operating system developed by Microsoft for mobile and embedded devices. It was part of the Windows Embedded family and served as the software foun ...
'' 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. An ...
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 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 An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
with the other
Microsoft SQL Server Microsoft SQL Server is a proprietary relational database management system developed by Microsoft using Structured Query Language (SQL, often pronounced "sequel"). As a database server, it is a software product with the primary function of ...
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 Entity Framework (EF) is an open source object–relational mapping (ORM) framework for ADO.NET. It was originally shipped as an integral part of .NET Framework, however starting with Entity Framework version 6.0 it has been delivered separatel ...
. Future releases will unify the synchronization capabilities with Microsoft Synchronization Services. Unlike other editions of
Microsoft SQL Server Microsoft SQL Server is a proprietary relational database management system developed by Microsoft using Structured Query Language (SQL, often pronounced "sequel"). As a database server, it is a software product with the primary function of ...
, 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 Memory footprint refers to the amount of main memory that a program uses or references while running. The word footprint generally refers to the extent of physical dimensions that an object occupies, giving a sense of its size. In computing, t ...
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 named Windows Store apps, Metro-style apps and Modern apps) are applications that can be used across all compatible Microsoft Windows devices. They are primarily purchased and downloaded via the ...
s for Windows 8 cannot use SQL Server Compact edition, or any other edition of SQL Server.


Support

SQL CE databases can support
ACID An acid is a molecule or ion capable of either donating a proton (i.e. Hydron, hydrogen cation, H+), known as a Brønsted–Lowry acid–base theory, Brønsted–Lowry acid, or forming a covalent bond with an electron pair, known as a Lewis ...
-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 proprietary relational database management system developed by Microsoft using Structured Query Language (SQL, often pronounced "sequel"). As a database server, it is a software product with the primary function of ...
, SQL CE supports transactions, referential integrity constraints, locking as well as multiple connections to the database store. However,
nested transaction A nested transaction is a database transaction that is started by an instruction within the scope of an already started transaction. Nested transactions are implemented differently in different databases. However, they have in common that the chang ...
s are not supported, even though parallel transactions (on different tables) are. The current release does not support stored procedures or native
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
data type either. It uses a subset of T-SQL for querying and due to lack of XML support,
XQuery XQuery (XML Query) is a query language and functional programming language designed to query and transform collections of structured and unstructured data, primarily in the form of XML. It also supports text data and, through implementation-sp ...
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) developed by Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms ...
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 2005 ...
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 law, cryptography, encryption (more specifically, Code, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the inf ...
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. 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 Personal digital assistant, PDAs) store and share data over a mobile network, or access a database which is actually stored by the mobile device. This could be a list of contacts, price information, di ...
*
SQLite SQLite ( "S-Q-L-ite", "sequel-ite") is a free and open-source relational 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 ...
* *
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 fir ...
(ACE and formerly JET) * HSQLDB *
Firebird Firebird and fire bird may refer to: Mythical birds * Phoenix (mythology), sacred firebird found in the mythologies of many cultures ** Fenghuang, sometimes called Chinese phoenix * Vermilion bird, one of the four symbols of the Chinese constella ...


References


External links


Microsoft's Embedded Database - SQL Server Compact - Team Blog
at
Microsoft Learn Microsoft Learn is a library of technical documentation and training for end users, developers, and IT professionals who work with Microsoft products. Microsoft Learn was introduced in September 2018. In 2022, Microsoft Docs, the technical documen ...
* {{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