SQL Server Compact
Encyclopedia
Microsoft SQL Server Compact (SQL CE) is a compact relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

 produced by Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 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 and SQL Server Mobile Edition. The latest release is the SQL Server Compact 4.0 supporting .NET Framework 4.0
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

, and dropping support for Windows Mobile
Windows Mobile
Windows Mobile is a mobile operating system developed by Microsoft that was used in smartphones and Pocket PCs, but by 2011 was rarely supplied on new phones. The last version is "Windows Mobile 6.5.5"; it is superseded by Windows Phone, which does not run Windows Mobile software.Windows Mobile is...

 in this release. 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.

Overview

SQL Server Compact shares a common API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 with the other Microsoft SQL Server
Microsoft SQL Server
Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...

 editions. It also includes ADO.NET
ADO.NET
ADO.NET is a set of computer software components that programmers can use to access data and data services. It is a part of the base class library that is included with the Microsoft .NET Framework. It is commonly used by programmers to access and modify data stored in relational database systems,...

 providers for data access using ADO.NET APIs, and built-in synchronization capabilities, as well as support for LINQ
Language Integrated Query
Language Integrated Query is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages, although ports exist for Java, PHP and JavaScript....

 and Entity Framework
ADO.NET Entity Framework
ADO.NET Entity Framework is an object-relational mapping framework for the .NET Framework.-Overview:ADO.NET Entity Framework abstracts the relational schema of the data that is stored in a database and presents its conceptual schema to the application...

. Future releases will unify the synchronization capabilities with Microsoft Synchronization Services. Unlike other editions of Microsoft SQL Server
Microsoft SQL Server
Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...

, SQL CE runs in-process with the application which is hosting it; while having a memory footprint of less than 2 MB
Megabyte
The megabyte is a multiple of the unit byte for digital information storage or transmission with two different values depending on context: bytes generally for computer memory; and one million bytes generally for computer storage. The IEEE Standards Board has decided that "Mega will mean 1 000...

; however, all SQL CE instances share the same memory pool.

Support

SQL CE databases are ACID
ACID
In computer science, ACID is a set of properties that guarantee database transactions are processed reliably. In the context of databases, a single logical operation on the data is called a transaction...

-compliant. Like Microsoft SQL Server
Microsoft SQL Server
Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...

, SQL CE supports transactions, referential integrity constraints, locking as well as multiple connections to the database store. However, nested transaction
Nested transaction
With reference to a database transaction, a nested transaction occurs when a new transaction is started by an instruction that is already inside an existing transaction. The new transaction is said to be nested within the existing transaction, hence the term....

s are not supported, even though parallel transactions (on different tables) are. The current release does not support stored procedures or native XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 data type either. It uses a subset of T-SQL for querying and due to lack of XML support, XQuery
XQuery
- Features :XQuery provides the means to extract and manipulate data from XML documents or any data source that can be viewed as XML, such as relational databases or office documents....

 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
Microsoft Visual Studio
Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

 and SQL Server Management Studio
SQL Server Management Studio
SQL Server Management Studio is a tool included with Microsoft SQL Server 2005 and later versions for configuring, managing, and administering all components within Microsoft SQL Server...

 as well.

File Format

SQL CE databases reside in a single .sdf file, which can be up to 4 GB
Gigabyte
The gigabyte is a multiple of the unit byte for digital information storage. The prefix giga means 109 in the International System of Units , therefore 1 gigabyte is...

 in size. The .sdf file can be encrypted with 128-bit encryption
Encryption
In cryptography, encryption is the process of transforming information using an algorithm to make it unreadable to anyone except those possessing special knowledge, usually referred to as a key. The result of the process is encrypted information...

 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
ClickOnce is a Microsoft technology that enables the user to install and run a Windows application by clicking a link in a web page. ClickOnce is a component of Microsoft .NET Framework 2.0 and later, supports deploying applications made with Windows Forms or Windows Presentation Foundation...

. 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
ADO.NET
ADO.NET is a set of computer software components that programmers can use to access data and data services. It is a part of the base class library that is included with the Microsoft .NET Framework. It is commonly used by programmers to access and modify data stored in relational database systems,...

 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
Manifest (.NET Framework)
An assembly manifest is a text file containing metadata about .NET assemblies. It describes the relationship and dependencies of the components in the assembly, versioning information, scope information and the security permissions required by the assembly....

 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.

Naming of the database file does not have to conform to the .sdf standard 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.

See also

  • Microsoft SQL Server
    Microsoft SQL Server
    Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...

  • SQL Server Express
    SQL Server Express
    Microsoft SQL Server Express, a freely downloadable and distributable version of Microsoft's SQL Server relational database management system, comprises a database specifically targeted for embedded and smaller-scale applications.- Capabilities :...

  • Sybase
    Sybase
    Sybase, an SAP company, is an enterprise software and services company offering software to manage, analyze, and mobilize information, using relational databases, analytics and data warehousing solutions and mobile applications development platforms....

     SQL Anywhere
    SQL Anywhere
    SQL Anywhere is a relational database management system product from the company Sybase iAnywhere, a subsidiary of Sybase.- Features :...

  • SQLite
    SQLite
    SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK