SQL Server Compact
   HOME

TheInfoList



OR:

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 Britis ...
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 relati ...
produced by
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
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 base ...
'' 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 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 Language Integrated Query (LINQ, pronounced "link") is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages, originally released as a major part of .NET Framework 3.5 in 2007. LINQ extends the langu ...
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 separately ...
. Future releases will unify the synchronization capabilities with Microsoft Synchronization Services. 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 In computer science, ACID ( atomicity, consistency, isolation, durability) is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps. In the context of databases, a se ...
-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 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 chan ...
s 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 di ...
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. T ...
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, v ...
for querying and due to lack of XML support,
XQuery XQuery (XML Query) is a query and functional programming language that queries and transforms collections of structured and unstructured data, usually in the form of XML, text and with vendor-specific extensions for other data formats (JSON, b ...
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 websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms such ...
and some older versions of SQL Server Management Studio 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 d ...
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 *
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 (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 kilobyte ...
* 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