0% found this document useful (0 votes)
54 views1,371 pages

SQL Server CE

The document provides an overview of Microsoft SQL Server 2000 Windows CE Edition (SQL Server CE), detailing its installation, configuration, and development environments. It highlights the essential components, connectivity solutions, and security features for mobile and embedded devices. Additionally, it outlines the necessary hardware and software requirements for deploying SQL Server CE applications.

Uploaded by

abel cornelio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1,371 pages

SQL Server CE

The document provides an overview of Microsoft SQL Server 2000 Windows CE Edition (SQL Server CE), detailing its installation, configuration, and development environments. It highlights the essential components, connectivity solutions, and security features for mobile and embedded devices. Additionally, it outlines the necessary hardware and software requirements for deploying SQL Server CE applications.

Uploaded by

abel cornelio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1371

Welcome to the MSDN Library

Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition >

MSDN Library Go
Advanced Search SQL Server CE Books Online

Up One Level
Getting Started with SQL Server CE Books Online
What's New
SQL Server CE Overview
Installing SQL Server CE
Configuring Security for Connectivity
Managing Connectivity
Working with SQL Server CE Databases
SQL Reference for SQL Server CE
Building Applications
Deploying Applications
Sample Applications
Technical Support
Troubleshooting

Microsoft Accessibility Web Site

MSDN Online

Microsoft TechNet

Microsoft SQL Server CE Product Web Site

Microsoft SQL Server Product Web Site

Samples

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_technical_support.asp (1 of 2) [22/07/2004 04:37:06 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_technical_support.asp (2 of 2) [22/07/2004 04:37:06 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0
MSDN Library Go
Advanced Search SQL Server CE Books Online
Installing SQL Server CE

The following topics in this section describe installing Microsoft® SQL Server™ 2000 Windows® CE Edition 2.0 (SQL Server CE).

Topic Description
Before you begin
Up One Level SQL Server CE Installation Overview Describes the various systems and configuration options that can be used in a SQL Server CE environment.

SQL Server CE Installation Overview Hardware and Software Requirements Lists hardware and software requirements for each system.

Hardware and Software Requirements Upgrading from Earlier Versions of SQL Server CE Provides information on upgrading from SQL Server CE 1.0 and SQL Server CE 1.1.

Upgrading from Earlier Versions of SQL Server CE Desktop installations

Installing SQL Server CE with Visual Studio .NET Describes installing SQL Server CE on a computer running the Microsoft Visual Studio® .NET development environment.
Installing SQL Server CE with Visual Studio .NET Installing SQL Server CE with eMbedded Visual Tools Describes installing SQL Server CE on a computer running the Microsoft eMbedded Visual Tools development environment.

Installing SQL Server CE with eMbedded Visual Tools Installing SQL Server CE with Platform Builder Describes creating a custom Windows CE operating system that includes SQL Server CE using Platform Builder.

Installing SQL Server CE with Platform Builder Device installations

Installing SQL Server CE on a Windows CE-based Device Installing SQL Server CE on a Windows CE-based Device Describes installing SQL Server CE on a Windows CE-based device.

Server installations
Installing SQL Server CE on an IIS System Installing SQL Server CE on an IIS System Describes installing SQL Server CE on a computer running Microsoft Internet Information Services (IIS).

Installing SQL Server CE on a SQL Server System Installing SQL Server CE on a SQL Server System Describes installing SQL Server CE on a computer running an instance of Microsoft SQL Server.

Using SQL Server CE Relay with an ActiveSync System Other installations

Installing SQL Server CE Query Analyzer


Using SQL Server CE Relay with an ActiveSync System Describes installing SQL Server CE Relay on a computer running Microsoft ActiveSync®.

Installing SQL Server CE Query Analyzer Describes installing SQL Server CE Query Analyzer on a Windows CE-based device.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_sql_server_ce.asp [22/07/2004 04:37:43 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0
MSDN Library Go
Advanced Search SQL Server CE Books Online
SQL Server CE Overview

Microsoft® SQL Server™ 2000 Windows® CE Edition 2.0 (SQL Server CE) extends Microsoft SQL Server to Microsoft Windows CE-based mobile devices, while
providing developers with a consistent programming model for rapid application development. SQL Server CE delivers essential relational database functionality in a
small footprint: a robust data store; an optimizing query processor; and reliable, scalable connectivity capabilities.

This section provides an overview of the SQL Server CE environment, including information about components, architecture, database engine, connectivity, and
Up One Level security. For complete information, see the relevant sections in this documentation.

SQL Server CE Environment


Client and Server Environments The following table lists the main sections of SQL Server CE Books Online.

Development Environment
SQL Server CE Database Engine Section Description

Connectivity Solutions Installing SQL Server CE Describes the hardware and software requirements for SQL Server CE and how to install the SQL Server CE platform.

SQL Server CE Security Configuring Security for Connectivity Describes how to configure a connection between SQL Server and Windows CE-based applications.

Managing Connectivity Provides information about specific connectivity solutions, including remote data access (RDA) and replication.

Working with SQL Server CE Databases Provides information about how to create and work with SQL Server CE databases, and how to access data in these databases.

Using SQL Server CE Query Analyzer Describes the user interface of SQL Server CE Query Analyzer and how you can use these features to perform database tasks.

SQL Reference for SQL Server CE Provides reference for the SQL grammar used to query or change data in SQL Server CE databases.

Building Applications Provides programming reference for Microsoft .NET Compact Framework Data Providers, Microsoft ActiveX® Data Objects for Windows CE
(ADOCE), replication, RDA, and error handling.

Deploying Applications Describes how to package and distribute SQL Server CE-based applications.

Sample Applications Provides sample applications that demonstrate the use of replication and RDA connectivity in the Microsoft Visual Studio® .NET and the
Microsoft eMbedded Visual Tools development environments.

Troubleshooting Provides troubleshooting information and error message descriptions for connectivity, Windows security, and Microsoft Internet Information
Services (IIS) security.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_overview.asp [22/07/2004 04:39:21 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
MSDN Library Go Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Server CE Overview

Advanced Search
SQL Server CE Books Online
SQL Server CE Environment

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides a compact database solution for
mobile and embedded devices. By using Microsoft Visual Studio® .NET or Microsoft eMbedded Visual Tools, you
can extend the enterprise data management capabilities of SQL Server to Windows CE-based devices. The
following illustration shows the relationship of three typical environments in which SQL Server CE can be used.

Up One Level
SQL Server CE Environment
Client and Server Environments
Development Environment
SQL Server CE Database Engine
Connectivity Solutions
SQL Server CE Security

Development Environment

This is the computer on which Windows CE-based applications are developed. This computer must have one of
the following development environments:

● Microsoft Visual Studio .NET


● Microsoft eMbedded Visual Tools version 3.0 installed with at least one of the following software development kits (SDKs): Handheld PC 2000
SDK, Pocket PC SDK, or the Windows Powered Pocket PC 2002 SDK.

Client Environment

This is the device on which the Windows CE-based application is deployed. When the Windows CE-based device
does not contain network connectivity, Microsoft ActiveSync® can be used to connect to the server
environment.

Server Environment

This is the computer(s) that runs Microsoft Internet Information Services (IIS) and an instance of Microsoft SQL
Server. You can run IIS and SQL Server on the same computer or configure them over several computers.
Remote data access (RDA) and merge replication communicate with SQL Server through IIS.

http://msdn.microsoft.com/library/default.asp?url...en-us/sqlce/htm/_lce_sql_server_ce_components.asp (1 of 2) [22/07/2004 04:39:51 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition >
MSDN Library Go Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Server CE Overview

Advanced Search
SQL Server CE Books Online
Client and Server Environments

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) relies on several components to exchange data from a Microsoft Windows CE-
based device to an instance of SQL Server. The following illustration shows the relationship between the different components.

Up One Level
SQL Server CE Environment
Client and Server Environments
Development Environment
SQL Server CE Database Engine
Connectivity Solutions
SQL Server CE Security

SQL Server CE Database Engine

The SQL Server CE database engine manages the SQL Server data store on the Windows CE-based device. The SQL Server CE database engine can
track all database records that are inserted, updated, or deleted by maintaining a small amount of change tracking information with each record. The
tracking functionality is enabled when you use one of the two connectivity solutions.

SQL Server CE Client Agent

The SQL Server CE Client Agent is the primary component for connectivity on the Windows CE-based device. It implements these custom SQL Server
CE objects: the Replication object, Remote Data Access (RDA) object, and Engine object. By using these objects, applications can programmatically
control connections to SQL Server.

SQL Server CE Server Agent

The SQL Server CE Server Agent handles the HTTP requests made by the SQL Server CE Client Agent. When an application makes a request, the
SQL Server CE Client Agent sends the request to the SQL Server CE Server Agent through HTTP. The SQL Server CE Server Agent connects to SQL
Server and returns the resulting recordset to the SQL Server CE Client Agent through HTTP. Additional SQL Server connectivity components are
involved in this process and are also located on the computer running Microsoft Internet Information Services (IIS), although they are not shown in
the preceding illustration.

Replication and RDA handle HTTP requests differently and use different SQL Server connectivity components on the computer running IIS. For more
information, see Managing Connectivity.

Supported Connectivity Solutions

SQL Server CE connectivity solutions communicate using Web protocols, HTTP or HTTPS. The SQL Server CE Client Agent, which resides on the
Windows CE-based device, uses HTTP(S) to communicate with the SQL Server CE Server Agent on the Web server. The SQL Server CE Server Agent,
which resides on the computer running IIS, communicates with SQL Server using either replication or remote data access.

Note SQL Server CE connectivity solutions are primarily intended for Windows CE-based devices that are occasionally
connected to the network.

SQL Server CE works with the following network connectivity as long as they are configured to support HTTP(S):

http://msdn.microsoft.com/library/default.asp?url=/...en-us/sqlce/htm/_lce_sql_server_ce_architecture.asp (1 of 2) [22/07/2004 04:40:16 p.m.]


Welcome to the MSDN Library
● Ethernet
● Wireless LANs
● Wireless WANs

By using Microsoft ActiveSync® 3.5 and a Pocket PC 2002 device connected using serial, infrared, or USB, you can directly access SQL Server
through the network connection of the desktop computer. Other device and ActiveSync combinations require SQL Server CE Relay to be configured
on the desktop computer.

SQL Server CE can use the Secure Sockets Layer (SSL) feature of IIS to encrypt data propagated between the device running SQL Server CE and the
computer running SQL Server.

In addition, SQL Server CE connectivity solutions optimize wireless communication by compressing data to minimize the amount of data sent over
the network. Data is propagated between the Windows CE-based device and the server by using a simple protocol patterned after file transfer
protocols. SQL Server CE connectivity solutions recover from communication failures by restarting from the last successfully transmitted block of
data, as long as the connection recovers within a time-out period of approximately two minutes. This makes synchronization possible even if the
underlying transport is not reliable.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...en-us/sqlce/htm/_lce_sql_server_ce_architecture.asp (2 of 2) [22/07/2004 04:40:16 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
MSDN Library Go Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Server CE Overview

Advanced Search
SQL Server CE Books Online
Development Environment

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports two development
environments: Microsoft Visual Studio® .NET and Microsoft eMbedded Visual Tools. Both environments
provide a set of data access application programming interfaces (APIs) and a subset of SQL syntax that work
specifically with SQL Server CE.

Up One Level
SQL Server CE Environment Microsoft Visual Studio .NET
Client and Server Environments
Microsoft Visual Studio .NET provides an application development platform for Microsoft Windows CE-based
Development Environment devices. Using Microsoft Visual Basic® .NET or Microsoft Visual C#™ .NET, you can develop Windows CE-
based applications that communicate with databases in SQL Server and SQL Server CE.
SQL Server CE Database Engine
Connectivity Solutions
The following illustration shows the relationship of the different components.
SQL Server CE Security

For more information, see Development Tools.

Microsoft eMbedded Visual Tools

By using Microsoft eMbedded Visual Basic 3.0 or Microsoft eMbedded Visual C++® version 3.0 and version
4.0, you can apply your knowledge of Visual Basic or Visual C++ to develop Windows CE-based applications.
You can create application code using a code editor, form editor, and property pane, which are similar to
those used in Visual Basic or Visual C++. Like Visual Basic and Visual C++, eMbedded Visual Tools also
provides an integrated development environment (IDE).

The following illustration shows the relationship of the different components.

http://msdn.microsoft.com/library/default.asp?url.../en-us/sqlce/htm/_lce_development_environment.asp (1 of 3) [22/07/2004 04:41:41 p.m.]


Welcome to the MSDN Library

To develop applications with the eMbedded Visual Tools, the software development kit (SDK) for Handheld PC
2000, Pocket PC, or Pocket PC 2002 must be installed on the device. These SDKs include Windows CE-based
device emulators, which provide the look of a physical device on the desktop computer. SQL Server CE-based
applications can be created on a desktop computer and then tested on the emulator; so, no device is
required.

For more information, see Development Tools.

Familiar Data Access Technologies

SQL Server CE is implemented as a set of dynamic-link libraries (DLLs) that support the following data access
technologies:

● Microsoft ActiveX® Data Objects for Windows CE 3.1 (ADOCE) and Microsoft ActiveX Data Objects Extensions for Data Definition Language
(DDL) and Security (ADOXCE)
● ADO.NET
● OLE DB Provider for SQL Server CE

ADOCE, ADOXCE, and ADO.NET are based on ADO, which is a high-level interface to all types of data. ADOCE
provides consistent, high-performance access to data for developers using eMbedded Visual Basic to program
applications for Windows CE. ADOCE is the most widely used interface for creating, accessing, and modifying
SQL Server CE databases. ADOXCE extends ADOCE to expose additional objects for creating, modifying, and
deleting schema objects. Schema objects are the attributes of the database, such as columns, indexes,
tables, and properties. A subset of ADO.NET, which provides the same high-performance access to data for
developers who are using Visual Basic .NET and C# as ADOCE, is available for Windows CE-based devices.

OLE DB is a low-level data interface technology. OLE DB for SQL Server CE can be used from eMbedded Visual
C++, and it provides more granular capabilities than ADOCE or ADOXCE when used with SQL Server CE. Of
all the data access APIs, OLE DB for SQL Server CE provides the fastest data manipulation and access.

For more information about programming with these objects, see Building Applications.

Familiar SQL Grammar

SQL Server CE includes SQL grammar that allows applications to query a database and insert, update, and
delete data in the database. This grammar is compatible with the SQL grammar of other versions of Microsoft
SQL Server. Most statements that run on SQL Server CE also run on SQL Server databases.

SQL Server CE also supports intrinsic functions that are consistent with functions provided in SQL Server.

For more information, see SQL Reference for SQL Server CE.

http://msdn.microsoft.com/library/default.asp?url.../en-us/sqlce/htm/_lce_development_environment.asp (2 of 3) [22/07/2004 04:41:41 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Server CE Overview
Advanced Search

SQL Server CE Books Online


SQL Server CE Database Engine

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides:

SQL grammar compatible with SQL Server 2000.


Up One Level

SQL Server CE Environment Using data definition language (DDL), you can create databases, alter tables, enforce and check referential
integrity, and set default values. Using data manipulation language (DML), you can insert, update, and delete data.

Client and Server Environments You can also use the SELECT statement, UNION, intrinsic functions, and parameterized queries.

Multiple-column indexes and matching index limits.

Development Environment

● Transaction support.
● Referential integrity.
128-bit file-level encryption and password protection.
SQL Server CE Database Engine

Connectivity Solutions Compact Footprint


SQL Server CE Security
The SQL Server CE database engine occupies approximately 1.2 to 1.6 megabytes (MB) of
disk space, depending on the processor of the target device. SQL Server CE supports
databases up to 2 gigabytes (GB), with support for BLOBs of up to 1 GB.

For more information about the SQL Server CE database engine, see Working with SQL
Server CE Databases.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li...s/sqlce/htm/_lce_high-performance_database_engine.asp [22/07/2004 04:42:01 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Server CE Overview
Advanced Search

SQL Server CE Books Online


Connectivity Solutions

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports two
methods of connecting to and exchanging data with a data source:

Up One Level ● Remote data access (RDA)


● Merge replication

SQL Server CE Environment


Client and Server Environments These connectivity solutions use the authentication, authorization, and encryption services
of Microsoft Internet Information Services (IIS). The connectivity can be performed over
Development Environment wired and wireless LANs and WANs. You can configure Microsoft ActiveSync® 3.5 or
ActiveSync 3.1 with SQL Server CE Relay, to use the network connection on a desktop
SQL Server CE Database Engine computer to communicate with SQL Server. This eliminates the requirement for the
Windows CE-based device to have a network card or modem.
Connectivity Solutions
SQL Server CE Security
RDA

RDA provides a simple way for a Windows CE-based application to access data located in a
remote SQL Server 7.0 or SQL Server 2000 database. You can use RDA when you do not
need the full functionality of merge replication. You can use RDA without configuring SQL
Server replication or creating publications.

Applications can use RDA in two ways: The application can submit a data manipulation
language (DML) statement that is forwarded to the SQL Server system for execution, or the
application can supply an SQL query that returns a rowset. The resulting rowset is
transmitted to the Windows CE-based device where it is stored in a table. All changes made
by the application are optionally tracked, and at the request of the application, the updated
rows are sent back to the server, where they are applied to the SQL Server database.

For more information, see Using Remote Data Access (RDA).

Merge Replication

Merge replication in SQL Server CE is based on the merge replication implemented in


Microsoft SQL Server 2000. Merge replication is suited to portable devices because it
enables data to be updated independently on the portable device and the server. The data
on the device and the server can later be synchronized when the device is connected to the
server.

Common scenarios for merge replication include: read-only replication; data capture and
upload; and replication, updating and synchronization. Most applications use a combination
of these scenarios. For example, a sales support application might use read-only replication
to download a price list to a device while relying on data capture and upload to capture new
orders on the device and then upload them to a server.

You can use both horizontal and vertical filters to define and maintain unique subsets of
data for different clients or groups of clients. Horizontal filters can be used to replicate a
subset of the rows in a published table. Vertical filters can be used to replicate a subset of
the columns in a published table.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_connectivity_solutions.asp (1 of 2) [22/07/2004 04:42:31 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Server CE Overview
Advanced Search

SQL Server CE Books Online


SQL Server CE Security

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) connectivity security
relies on the security models of Microsoft Internet Information Services (IIS) and SQL
Server 2000.

Up One Level
IIS authentication and authorization are configured to control which users can invoke the
SQL Server CE Environment SQL Server CE Server Agent, thereby, controlling the users that can perform database
synchronization using merge replication or remote data access. IIS can be configured to use
Client and Server Environments Secure Sockets Layer (SSL) encryption. This safeguards the data sent between the Windows
CE-based device and IIS when database synchronization or remote database access is
Development Environment performed.

SQL Server CE Database Engine


Connectivity Solutions For more information, see Configuring Security for Connectivity.

SQL Server CE Security


In addition, a SQL Server CE database relies on a password and 128-bit encryption for
security. For more information, see Using SQL Server CE Database Security Features.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_server_ce_security.asp [22/07/2004 04:42:47 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server >
MSDN Library Go SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Installing SQL Server
CE
Advanced Search

SQL Server CE Books Online


SQL Server CE Installation Overview

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) is typically installed in an
enterprise environment, which requires installing and configuring up to five systems:

Up One Level ● Development environment (Microsoft Visual Studio® .NET or Microsoft eMbedded Visual Tools)
● Microsoft SQL Server system

SQL Server CE Installation Overview ●


Microsoft Internet Information Services (IIS) system
Microsoft Windows CE-based device
Microsoft ActiveSync® system (optional)
Hardware and Software Requirements

Upgrading from Earlier Versions of SQL Server CE After choosing a server configuration, reviewing the hardware and software requirements for each
system, and then installing the appropriate software, you are ready to install SQL Server CE.
Installing SQL Server CE with Visual Studio .NET
Installing SQL Server CE with eMbedded Visual Tools
Installing SQL Server CE with Platform Builder
Installing SQL Server CE on a Windows CE-based Device
Installing SQL Server CE on an IIS System
Installing SQL Server CE on a SQL Server System
Using SQL Server CE Relay with an ActiveSync System
Installing SQL Server CE Query Analyzer

Single- and Multiple-Server Environments

The servers in the SQL Server CE environment can be configured as either a single- or multiple-server
environment. In a single-server environment, all systems are on one computer. In a multiple-server
environment, the IIS and SQL Server systems are on different computers. As shown in the preceding
illustration, a Windows CE-based device can connect directly to a single-server running IIS and SQL
Server, multiple-servers (one running IIS and the other running SQL Server), or a workstation running
a development environment. Application development environments for Windows CE-based mobile
devices include Microsoft Visual Studio .NET and Microsoft eMbedded Visual Tools. Depending on your
server configuration, you may have to install SQL Server CE Server Tools on more than one computer.
For example, if you have multiple computers running IIS, each computer running IIS must have SQL
Server CE Server Tools installed.

Multiple servers are typically used in production, especially in a corporate enterprise, because they
provide more flexibility and can better meet complex security needs. If you are setting up SQL Server
CE for the first time, consider setting up a single-server environment. This allows you to install all the
necessary server software on one computer. You can further simplify setup by combining a single-
server and development environment on one computer to create a complete development and test
environment. After you have successfully set up a single-server environment, you can easily migrate to
a multiple-server environment.

ActiveSync

ActiveSync is required in the development environment to deploy and debug applications. Microsoft
Windows Powered Pocket PC 2002 can use ActiveSync 3.5 or later to synchronize SQL Server CE over a
serial, infrared (IR), or USB connection. When using Pocket PC 2000 or Handheld PC 2000 mobile
devices, you must use SQL Server CE Relay in conjunction with IIS to synchronize over these
connections. For more information, see Using SQL Server CE Relay with an ActiveSync System.

See Also

Installing SQL Server CE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_server_configuration.asp (1 of 2) [22/07/2004 04:48:28 p.m.]


Welcome to the MSDN Library

Hardware and Software Requirements

Installing SQL Server CE on a Windows CE-based Device

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_server_configuration.asp (2 of 2) [22/07/2004 04:48:28 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
Hardware and Software Requirements

The tables in this topic describe the hardware and software requirements for each system that Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE) interacts with. For more information, see SQL Server CE Environment.

Hardware Requirements
Up One Level
SQL Server CE Installation Overview
Platform Requirements
Hardware and Software Requirements Development environment 45 MB of available disk space. The computer must have an additional 45 MB of temporary storage space for the setup files.

Upgrading from Earlier Versions of SQL Server CE Microsoft Windows CE-based device
(client environment)
Between 1 and 3 MB of available storage space, depending on processor type and components installed.
The file sizes for the SQL Server CE components vary by processor type and version of the Windows CE operating system. Space

Installing SQL Server CE with Visual Studio .NET


requirements also depend on the development environment and which SQL Server CE components you install.

Microsoft SQL Server system For more information, see "Installing SQL Server" in SQL Server Books Online.

Installing SQL Server CE with eMbedded Visual Tools (server environment)

Microsoft Internet Information Services (IIS) system 120 MB of available disk space.

Installing SQL Server CE with Platform Builder (server environment)

Installing SQL Server CE on a Windows CE-based Device


Installing SQL Server CE on an IIS System Operating System Requirements
Installing SQL Server CE on a SQL Server System
Using SQL Server CE Relay with an ActiveSync System Platform Supported operating systems

Installing SQL Server CE Query Analyzer Development environment Microsoft Windows 2000 and Windows XP. Microsoft ActiveSync® 3.1 or later is required.

SQL Server system For information, see "Installing SQL Server" in SQL Server Books Online.
(server environment)

IIS system (server environment) Microsoft Windows 2000 and Windows XP. Windows NT 4.0 is supported only for manual configurations of the SQL Server CE Server
Agent.

Windows CE-based device: Microsoft Windows Powered Pocket PC 2002, Pocket PC 2000, and Handheld PC 2000. Microsoft Windows CE .NET version 4.1 (Platform
Builder) is supported for embedded devices.

SQL Server Requirements

SQL Server Supported SQL Server CE features


SQL Server 2000 with Service Pack 1 or higher Merge replication and remote data access (RDA) are supported.

SQL Server version 7.0 with Service Pack 3 or higher RDA is supported; replication is not supported.

RDA and replication require that Microsoft Data Access Components (MDAC) 2.6 or later be present on the Microsoft Internet Information Services (IIS) system. If
MDAC 2.6 or later is not present on the IIS system, SQL Server CE Setup installs it when you specify the Server Tools installation option or launch the self-
extracting SQL Server CE Server Tools installation file (Sqlce20sql2ksp1.exe or Sqlce20sql2ksp2.exe).

SQL Server CE RDA and replication are supported with computers running any edition of Microsoft SQL Server 2000 with Service Pack 1 or higher. SQL Server CE
replication is not supported with earlier versions of SQL Server. RDA is supported on SQL Server 7.0, but only in a multiple-server environment; if IIS and SQL
Server are installed on the same computer (a single-server environment) SQL Server 2000 with Service Pack 1 or higher is required.

IIS and Internet Explorer Requirements

Component Requirements

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_hardware_and_software_requirements.asp (1 of 2) [22/07/2004 04:49:01 p.m.]


Welcome to the MSDN Library
Microsoft Internet Explorer 5.0 Internet Explorer 5.0 or later is required on the development system to access SQL Server CE Books Online.
Internet Explorer 5.0 or later is required on the IIS system.

Microsoft Internet Information Services (IIS) IIS versions supported on Microsoft Windows NT 4.0 with SP5 or higher, Microsoft Windows 2000 and Microsoft Windows XP.

ActiveSync Requirements

Component Requirements
ActiveSync 3.1 Microsoft Windows 98 Second Edition, Windows Millennium Edition, Windows NT® 4.0 with Service Pack 5 or later, or Windows 2000.

ActiveSync 3.5 (Recommended) Microsoft Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0 with Service Pack 6 or later, Windows 2000, or
Windows XP.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_hardware_and_software_requirements.asp (2 of 2) [22/07/2004 04:49:01 p.m.]


Upgrading from Earlier Versions of SQL Server CE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE

SQL Server CE Books Online


Upgrading from Earlier Versions of SQL Server CE

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports side-by-side installation. Versions of SQL Server CE can coexist on the
same computer, enabling a simple and gradual upgrade process. SQL Server CE connectivity requires that the client components on the Windows CE-
based device and the server components installed on the computer running Microsoft Internet Information Services (IIS) be the same major-release
version.

Upgrading Deployed Applications

When you upgrade, install SQL Server CE Server Tools first and then client components. Do not deploy newer client applications if you still have an earlier
version of SQL Server CE Server Tools on the computer running IIS. After all components are in place, redeploy the application to the devices. It is
important to ensure the upgraded application is available and functioning properly before removing the previous release of your application and the SQL
Server CE client components.

During the process of upgrading your application, you must change any references of SQL Server CE version 1.0 or 1.1 to SQL Server CE version 2.0.
When you upgrade the computer running IIS, you must install Server Tools for SQL Server CE 2.0. You can then configure a new virtual directory for SQL
Server CE 2.0 clients on this computer. As you deploy SQL Server CE 2.0 client components to your devices, you must update your application to use this
new virtual directory for SQL Server CE 2.0 by updating the InternetURL property of your Replication or Remote Data Access (RDA) objects. The new
InternetURL property ends with Sscesa20.dll instead of Sscesa10.dll. Updating the InternetURL property is critical because the SQL Server CE Client
Agent for SQL Server CE 2.0 can communicate only with the SQL Server CE Server Agent for SQL Server CE 2.0.

Note When you update your applications, it is not necessary to re-create the database files (.sdf files). SQL Server CE versions
2.0, 1.1, and 1.0 share the same file format.

See Also

Deploying Applications

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...ing_from_earlier_versions_of_sql_s_579.asp?frame=true [22/07/2004 04:49:15 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE
Advanced Search

SQL Server CE Books Online


Upgrading from Earlier Versions of SQL Server CE

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports side-by-side
installation. Versions of SQL Server CE can coexist on the same computer, enabling a simple
and gradual upgrade process. SQL Server CE connectivity requires that the client
components on the Windows CE-based device and the server components installed on the
Up One Level computer running Microsoft Internet Information Services (IIS) be the same major-release
version.
SQL Server CE Installation Overview
Hardware and Software Requirements
Upgrading Deployed Applications
Upgrading from Earlier Versions of SQL Server CE
Installing SQL Server CE with Visual Studio .NET When you upgrade, install SQL Server CE Server Tools first and then client components. Do
Installing SQL Server CE with eMbedded Visual Tools not deploy newer client applications if you still have an earlier version of SQL Server CE
Server Tools on the computer running IIS. After all components are in place, redeploy the
Installing SQL Server CE with Platform Builder application to the devices. It is important to ensure the upgraded application is available
and functioning properly before removing the previous release of your application and the
Installing SQL Server CE on a Windows CE-based Device SQL Server CE client components.

Installing SQL Server CE on an IIS System


Installing SQL Server CE on a SQL Server System During the process of upgrading your application, you must change any references of SQL
Server CE version 1.0 or 1.1 to SQL Server CE version 2.0. When you upgrade the computer
Using SQL Server CE Relay with an ActiveSync System running IIS, you must install Server Tools for SQL Server CE 2.0. You can then configure a
new virtual directory for SQL Server CE 2.0 clients on this computer. As you deploy SQL
Installing SQL Server CE Query Analyzer Server CE 2.0 client components to your devices, you must update your application to use
this new virtual directory for SQL Server CE 2.0 by updating the InternetURL property of
your Replication or Remote Data Access (RDA) objects. The new InternetURL property
ends with Sscesa20.dll instead of Sscesa10.dll. Updating the InternetURL property is
critical because the SQL Server CE Client Agent for SQL Server CE 2.0 can communicate
only with the SQL Server CE Server Agent for SQL Server CE 2.0.

Note When you update your applications, it is not necessary to re-


create the database files (.sdf files). SQL Server CE versions 2.0,
1.1, and 1.0 share the same file format.

See Also

Deploying Applications

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../_lce_upgrading_from_earlier_versions_of_sql_s_579.asp [22/07/2004 04:49:18 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
Installing SQL Server CE with Visual Studio .NET

Installing Microsoft® Visual Studio® .NET automatically configures the development environment for use with Microsoft SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). After installing Visual Studio .NET, you must still configure the computer running Microsoft Internet Information Services (IIS) and the Windows
CE-based device.

Up One Level File Locations and Descriptions


SQL Server CE Installation Overview
The following table lists the files, by location, that are installed on the development computer. By default, these files and folders are created in \Program
Hardware and Software Requirements Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000.

Upgrading from Earlier Versions of SQL Server CE


Installing SQL Server CE with Visual Studio .NET Location Contents
Installing SQL Server CE with eMbedded Visual Tools \Windows CE A folder that contains SQL Server CE Assemblies, System.Data.SqlServerCe.dll and System.Data.Common.

Installing SQL Server CE with Platform Builder \Windows CE\platform A series of subfolders. Each folder contains dynamic-link libraries (DLLs), Ssce20.dll, Ssceca20.dll, and Sscemw20.dll for use with each of the processors supported by SQL Server CE.
These folders also contain Isqlw20.exe, a program that implements the SQL Server CE Query Analyzer, and Ssceerror20en.dll, a DLL that provides error descriptions for use during
development. All of these components are included in the cab files Sqlce.platform.processor.cab and Sqlce.dev.platform.processor.cab, which are also located in the subfolder for each
Installing SQL Server CE on a Windows CE-based Device processor.

\ A folder that contains the SQL Server CE Books Online (Sqlce.chm), SQL Server CE Server Tools self-extracting executables (Sqlcesql2ksp1.exe and Sqlcesql2ksp2.exe), and SQL Server
Installing SQL Server CE on an IIS System CE Relay extension to Microsoft ActiveSync® (SSCERelay.exe).

Installing SQL Server CE on a SQL Server System


\Samples A series of folders containing sample applications.

Using SQL Server CE Relay with an ActiveSync System


Installing SQL Server CE Query Analyzer

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_sql_server_ce_with_visual_stu_533.asp [22/07/2004 04:49:34 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
Installing SQL Server CE with eMbedded Visual Tools

This topic describes the prerequisites and steps for installing Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) on a computer running the
Microsoft eMbedded Visual Tools development environment.

Note Set up the server configuration and the appropriate system software before you install SQL Server CE. For more information, see SQL
Server CE Installation Overview and Hardware and Software Requirements.
Up One Level
SQL Server CE Installation Overview
Before you install SQL Server CE on the eMbedded Visual Tools development system, you must install:
Hardware and Software Requirements
Upgrading from Earlier Versions of SQL Server CE
Microsoft ActiveSync® 3.1 or later
Installing SQL Server CE with Visual Studio .NET

● Microsoft eMbedded Visual Tools 3.0


● One of the following Windows CE Software Development Kits (SDKs): Pocket PC SDK, Handheld PC 2000 SDK, or the Microsoft Windows Powered Pocket PC 2002 SDK.

Installing SQL Server CE with eMbedded Visual Tools


Installing SQL Server CE with Platform Builder The Pocket PC SDK is included with eMbedded Visual Tools, and the other SDKs are available at this Microsoft Web site.

Installing SQL Server CE on a Windows CE-based Device


Installing SQL Server CE on an IIS System To install SQL Server CE on an eMbedded Visual Tools development system

Installing SQL Server CE on a SQL Server System


Using SQL Server CE Relay with an ActiveSync System
1. From Windows Explorer, navigate to the location of the source files for SQL Server CE, and then double-click setup.exe.
2. When prompted, click Development Tools.

Installing SQL Server CE Query Analyzer


If Microsoft Internet Information Services (IIS) is running on the same computer as the development environment, select the Server Tools check box if you want to install Server Tools at this time. For more
information, see Installing SQL Server CE on an IIS System.

After Setup completes, the development environment is configured to use SQL Server CE. SQL Server CE is not downloaded to the device until you begin your
development project. For more information, see Installing SQL Server CE on a Windows CE-based Device.

Note If you encounter any problems during the installation of Microsoft ActiveX® Data Objects for Windows CE 3.1 (ADOCE), you must
remove and reinstall SQL Server CE. The ADOCE components do not include a repair option under Add/Remove components in Control Panel.

File Locations and Descriptions

The following table lists the files, by location, that are installed on the development computer. By default, these files and folders are created in \Program
Files\Microsoft SQL Server CE 2.0.

Location Contents
\Device A series of subfolders. Each folder contains dynamic-link libraries (DLLs), Ssce20.dll and Ssceca20.dll, for use with each of the processors supported by SQL Server CE.
These folders also contain DllRegister.exe, a tool that registers the DLLs, Isqlw20.exe, a program that implements SQL Server CE Query Analyzer, and Ssceerror20en.dll, a DLL that provides error
descriptions for use during development.

\Inc Include files for use with Microsoft eMbedded Visual Basic® and Microsoft eMbedded Visual C++®.
Ca_mergex20.h is the header for the SQL Server CE Microsoft ActiveX objects.
Ssceoledb.h is the SQL SERVER CE header for OLE DB.

\Lib A series of folders. Each folder contains the library Ca_mergex20.lib for the SQL Server CE ActiveX objects. There is a separate folder for each processor supported by SQL Server CE.
A single type library (Ca_mergex20.tlb) is located in the root of this directory. It describes the SQL Server CE RDA, replication, and Engine objects.

\Relay A folder that contains the SQL Server CE Relay extension to ActiveSync (SSCERelay.exe).

\Redist A series of folders containing the components that you might have to include together when you deploy an application, including SQL Server CE Server Tools self-extracting executables
(Sqlce20sql2ksp1.exe and Sqlce20sql2ksp2.exe) and SQL Server CE Relay.

\Samples A series of folders containing sample applications.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_sql_server_ce_with_the_embedd_705.asp (1 of 2) [22/07/2004 04:49:46 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
Installing SQL Server CE with Platform Builder

Microsoft® Platform Builder is used to create a custom Microsoft Windows® CE operating system for use in a custom Windows CE-based device, such as an
embedded controller for a piece of equipment. Microsoft SQL Server™ 2000 Windows CE Edition (SQL Server CE) supports Microsoft Platform Builder for Microsoft
Windows CE .NET version 4.1.

Before you install SQL Server CE, you must install Microsoft ActiveSync® 3.1 or later and Microsoft Platform Builder for Microsoft Windows CE .NET version 4.1.
Up One Level
SQL Server CE Installation Overview
To install SQL Server CE on a computer with Platform Builder
Hardware and Software Requirements
Upgrading from Earlier Versions of SQL Server CE 1. From Windows Explorer, navigate to the location of the source files for Microsoft SQL Server CE, and then double-click setup.exe.

Installing SQL Server CE with Visual Studio .NET


2. When prompted, click Development Tools.

Installing SQL Server CE with eMbedded Visual Tools After Setup completes, the platform builder environment is configured to use SQL Server CE.
Installing SQL Server CE with Platform Builder
Installing SQL Server CE on a Windows CE-based Device
File Locations and Descriptions
Installing SQL Server CE on an IIS System
Installing SQL Server CE on a SQL Server System The following folder and files are installed on the computer running Platform Builder. By default, this folder and these files are created in
Using SQL Server CE Relay with an ActiveSync System \WinCE410\Others\SqlServerCE2. These files are installed in addition to the files specified in Installing SQL Server CE with eMbedded Visual Tools.

Installing SQL Server CE Query Analyzer


Location Contents
\Device A series of subfolders. Each folder contains dynamic-link libraries (DLLs), Ssce20.dll and Ssceca20.dll, for use with each of the processors supported by SQL Server CE.
These folders also contain DllRegister.exe, a tool that registers the DLLs, Isqlw20.exe, a program that implements SQL Server CE Query Analyzer, and Ssceerror20en.dll, a DLL that provides error
descriptions for use during development.

Important If you install eMbedded Visual Tools and one of the supported SDKs on the same computer with Platform Builder after SQL
Server CE is installed, you must reinstall SQL Server CE to properly register SQL Server CE with the SDKs.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_sql_server_ce_with_platform_b_705.asp [22/07/2004 04:50:03 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE
Advanced Search

SQL Server CE Books Online


Installing SQL Server CE on a Windows CE-based Device

After you install Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) on a
development system, you must install SQL Server CE on a Windows CE-based device. The
process for installing SQL Server CE on the device depends upon whether you are using the
Microsoft Visual Studio® .NET or the Microsoft eMbedded Visual Tools development
Up One Level environment. The following topics describe the installation process for each environment:

Installing SQL Server CE on a Device Using Visual Studio .NET


Installing SQL Server CE on a Device Using Visual Studio .NET
Installing SQL Server CE on a Device Using eMbedded Visual Tools

● Installing SQL Server CE on a Device Using eMbedded Visual Tools

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...m/_lce_using_installing_sql_server_ce_with_visu_705.asp [22/07/2004 04:50:20 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE > Installing SQL Server CE on a Windows CE-based Device
Advanced Search

SQL Server CE Books Online


Installing SQL Server CE on a Device Using Visual Studio .NET

In the Microsoft® Visual Studio® .NET development system, you can use one of the
following procedures to install the Microsoft SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) system files to a Windows CE-based device:

Up One Level
Include SQL Server CE in your project.
Installing SQL Server CE on a Device Using Visual Studio .NET

Installing SQL Server CE on a Device Using eMbedded Visual Tools This is the most common method for installing SQL Server CE on a Windows CE device. To include SQL Server CE
in your project, on the Project menu, click Add Reference, and select System.Data.SqlServerCe.

● Manually copy and extract the .cab files.

The Netcf.core.platform.processor.cab and Sqlce.platform.processor.cab files are installed by default in \Program


Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\platform\processor.

The Sqlce.dev.platform.processor.cab file includes SQL Server CE Query Analyzer and the DLLs that provide error
descriptions for use during development (Ssceerror20en.dll and Msdaeren.dll).

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...lce_using_installing_sql_server_ce_with_visu_705_vs.asp [22/07/2004 04:50:27 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE > Installing SQL Server CE on a Windows CE-based Device
MSDN Library Go
Advanced Search SQL Server CE Books Online
Installing SQL Server CE on a Device Using eMbedded Visual Tools

In the Microsoft® eMbedded Visual Tools development system, you can use either an automated process with Microsoft eMbedded Visual Basic® or a manual
process to download Microsoft SQL Server™ 2000 Windows® CE Edition (SQL Server CE) to the Windows CE-based device.

eMbedded Visual Basic Automated Process


Up One Level
Installing SQL Server CE on a Device Using Visual Studio .NET Using eMbedded Visual Basic to include SQL Server CE in your project is the most common method for installing SQL Server CE on a Windows CE-based device. To
include SQL Server CE in your project, on the Project menu, select References, Microsoft CE SQL Server Control 2.0, and then Microsoft CE ADO Control
Installing SQL Server CE on a Device Using eMbedded Visual Tools 3.1.

Note In the event of installation problems, you can force eMbedded Visual Basic to download components again: On the Project menu,
click Properties. On the General tab, set the Update Components Frequency to Always, and select the Project Components check
box.

If you are using Microsoft ActiveX® Data Objects Extensions for Data Definition Language (DDL) and Security (ADOXCE), you must also include Microsoft CE
ADO Ext. 3.1 for DDL. For more information, see Deploying Applications from eMbedded Visual Tools.

Manual Installation Process

You can manually install SQL Server CE and your eMbedded Visual Tools application on a Windows CE-based device by copying and registering all the required
files. Use the following information to determine which files the application requires. Select the files appropriate for the processor type of the Windows CE-based
device. To determine the processor type of the device, see the device documentation.

Application Files

On Pocket PCs, you can copy the application executable to the \Windows\Start Menu folder, and then run it from the Start menu on the device. The application
executable file is located in the project tree that you create:

● Microsoft eMbedded Visual Basic creates the executable file directly in the project subdirectory.
● Microsoft eMbedded Visual C++® creates a separate subdirectory for each platform processor type that you want it to build. For example, MIPS processor application executables are created in \projectname\MIPSRel
for the release version and \projectname\MIPSDbg for the debug version.

SQL Server CE Files

Copy the SQL Server CE files to the \Windows directory of the Windows CE-based device. These files are located in \Program Files\Microsoft SQL Server CE
2.0\Device\processor family\processor type by default. For more information about file locations and descriptions, see Installing SQL Server CE with eMbedded
Visual Tools.

File Requirement
Ssce20.dll Required. Must be registered.

Ssceca20.dll Required for replication and remote data access (RDA). Must be registered.

Ssceerror20en.dll Optional for error messages used during development.

Isqlw20.exe Optional for SQL Server CE Query Analyzer.

ADOCE and OLE DB Files

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_sql_server_ce_with_using_embe_533.asp (1 of 2) [22/07/2004 04:50:55 p.m.]


Welcome to the MSDN Library
Copy the SQL Server CE files to the \Windows directory on the Windows CE-based device. These files are located by default in \Windows CE
Tools\dataaccess31\Windows CE OS version\processor type.

File Requirement
Msdaeren.dll Optional for error messages. Msdaeren.dll is the English version of the Microsoft ActiveX Data Objects for Windows CE (ADOCE) error DLL and works on devices
of all languages. For localized ADOCE error messages, substitute the Msdaerxx.dll that corresponds to the language setting of the device.

Adoce31.dll Required. Must be registered.

Adoceoledb31.dll Required.

Adoxce31.dll Required for ADOXCE. Must be registered.

Registering the SQL Server CE Application on the Device

Use DllRegister.exe to register the DLLs that require registration. DllRegister.exe registers all the SQL Server CE, ADOCE, and OLE DB CE components on the
device and warns if optional components are missing from the device. DllRegister.exe is located by default in \Program Files\Microsoft SQL Server CE
2.0\Device\processor family\processor type.

To register the SQL Server CE application

1. Select the appropriate version of DllRegister.exe based on the processor type of the device.
2. Copy DllRegister.exe from the development system to the Windows CE-based device, and then run the executable. On Pocket PCs, you can copy DllRegister.exe to the \Windows\Start menu folder, and then run it
from the Start menu on the device.

Alternately, you can register the DLLs individually by using Regsvrce.exe from the Windows CE SDK or by calling the DllRegisterServer function in each DLL.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_sql_server_ce_with_using_embe_533.asp (2 of 2) [22/07/2004 04:50:55 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE
Advanced Search

SQL Server CE Books Online


Installing SQL Server CE on an IIS System

Microsoft® SQL Server™ 2000 Windows® CE Edition 2.0 (SQL Server CE) Server Tools are
required for applications that use SQL Server CE connectivity. If you use replication or
remote data access (RDA), you must install SQL Server CE Server Tools on the computer
running Microsoft Internet Information Services (IIS). Replication requires the SQL Server
Up One Level CE Server Tools installer appropriate for the service pack that SQL Server is running. SQL
Server CE ships with two installers: Sqlce20sql2ksp1.exe (SQL Server Service Pack 1) and
SQL Server CE Installation Overview Sqlce20sql2ksp2.exe (SQL Server Service Pack 2). If the instance of SQL Server is running
a service pack later than Service Pack 2, download an updated SQL Server CE Server Tools
Hardware and Software Requirements installer from this Microsoft Web site.

Upgrading from Earlier Versions of SQL Server CE


Installing SQL Server CE with Visual Studio .NET SQL Server CE Server Tools Setup installs the SQL Server CE Server Agent (Sscesa20.dll)
and the SQL Server CE Replication Provider (Sscerp20.dll) in \Program Files\Microsoft SQL
Installing SQL Server CE with eMbedded Visual Tools Server CE 2.0\Server and additional SQL Server replication components in \Program
Files\Microsoft SQL Server\80\Com.
Installing SQL Server CE with Platform Builder
Installing SQL Server CE on a Windows CE-based Device To set up SQL Server CE on the computer running IIS if you are using Microsoft
Installing SQL Server CE on an IIS System Visual Studio® .NET

Installing SQL Server CE on a SQL Server System


Using SQL Server CE Relay with an ActiveSync System
● From Windows Explorer on the computer running IIS, navigate to the source files for SQL Server CE, and then
double-click sqlce20sql2ksp1.exe or sqlce20sql2ksp2.exe. These files are installed in \Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000.

Installing SQL Server CE Query Analyzer


To set up SQL Server CE on the computer running IIS if you are using Microsoft
eMbedded Visual Tools

1. From Windows Explorer, navigate to the source files for SQL Server CE, and then double-click setup.exe.
2. When prompted, click Server Tools. If the computer running IIS also has SQL Server Service Pack 1 or Service
Pack 2 installed, the appropriate Server Tools installation file is installed. If the computer running IIS does not have
SQL Server installed, the installation file that corresponds to SQL Server Service Pack 1 (Sqlce20sql2ksp1.exe) is
installed.

Note You can also obtain the Server Tools installer


(Sqlce20sql2ksp1.exe and Sqlce20sql2ksp2.exe) from an
existing development system. SQL Server CE Setup
installs the files in \Program Files\Microsoft SQL Server
CE 2.0\Redist\Server.

SQL Server CE Connectivity Management Utility

At the end of the setup process, the SQL Server CE Server Tools installer optionally
launches the SQL Server CE Virtual Directory Creation Wizard, a component of the SQL
Server CE Connectivity Management utility. For more information about the SQL Server CE
Connectivity Management utility, see Configuring Security for Connectivity.

Support for Multilingual Environments

SQL Server CE Server Tools includes localized Microsoft Data Access Components (MDAC)
files that affect how setup screens and error messages are displayed. The language of SQL
Server CE Setup determines the language of the MDAC software in SQL Server CE Server
Tools. For other language-related issues, see Ensuring Proper ANSI to Unicode Conversions.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_installing_an_iis_system.asp [22/07/2004 04:51:28 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE
Advanced Search

SQL Server CE Books Online


Installing SQL Server CE on a SQL Server System

Using Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) in a Microsoft
SQL Server environment does not require the installation of any components on the SQL
Server system. However, if you are using remote data access (RDA) or replication, it is
important to install (on the computer running IIS) the version of the SQL Server CE Server
Up One Level Tools appropriate for the version of SQL Server you are using. For more information about
SQL Server CE Server Tools, see Installing SQL Server CE on an IIS System.
SQL Server CE Installation Overview
Hardware and Software Requirements
Upgrading from Earlier Versions of SQL Server CE See Also
Installing SQL Server CE with Visual Studio .NET
Installing SQL Server CE with eMbedded Visual Tools Hardware and Software Requirements

Installing SQL Server CE with Platform Builder


Installing SQL Server CE on a Windows CE-based Device
Installing SQL Server CE on an IIS System
Installing SQL Server CE on a SQL Server System
Using SQL Server CE Relay with an ActiveSync System
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
Installing SQL Server CE Query Analyzer
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...en-us/sqlce/htm/_lce_sql_server_system_installation.asp [22/07/2004 04:52:32 p.m.]


Using SQL Server CE Relay with an ActiveSync System (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE

SQL Server CE Books Online


Using SQL Server CE Relay with an ActiveSync System

If you use Microsoft® ActiveSync® 3.1 with a serial, infrared (IR), or USB connection to communicate between a Microsoft Windows® CE-based device
and an instance of Microsoft SQL Server™ using Microsoft Internet Information Services (IIS) through the network connection of a desktop computer, you
must install SQL Server CE Relay on the computer running ActiveSync. This is required both during application development and during application
deployment after development has been completed if the Windows CE-based devices do not have integrated network connectivity.

SQL Server CE Relay is installed automatically on the development computer when you install the development tools.

Important Microsoft Windows Powered Pocket PC 2002-based devices using ActiveSync 3.5 do not require SQL Server CE Relay,
because this configuration supports Ethernet connectivity to and from the device through the desktop computer.

To set up SQL Server CE Relay on the computer running ActiveSync

1. On the existing development computer, if you are using Microsoft eMbedded Visual Tools, navigate to the \Program Files\Microsoft SQL Server CE 2.0\Redist\Relay folder. If you are using Microsoft Visual
Studio® .NET, navigate to the \Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000 folder.
2. Copy Sscerelay.exe to any directory on the computer running ActiveSync.
3. Configure SQL Server CE Relay. For more information, see Using SQL Server CE Relay.

To remove SQL Server CE Relay from the computer running ActiveSync

SQL Server CE Relay is not installed using the setup process; therefore, you cannot use Control Panel to add or remove it. You must remove Relay using a
command prompt.

1. At the MS-DOS® command prompt, use the CD command to navigate to the location where you previously copied and configured SQL Server CE Relay on the computer running ActiveSync. For example,
type:

cd c:\Program Files\Microsoft SQL Server CE 2.0\Relay

2. To unregister SQL Server CE Relay, type:

Sscerelay /unregister

3. To delete Sscerelay.exe, type:

del sscerelay.exe

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_activesync_system_installation.asp?frame=true [22/07/2004 04:52:42 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE
Advanced Search

SQL Server CE Books Online


Using SQL Server CE Relay with an ActiveSync System

If you use Microsoft® ActiveSync® 3.1 with a serial, infrared (IR), or USB connection to
communicate between a Microsoft Windows® CE-based device and an instance of Microsoft
SQL Server™ using Microsoft Internet Information Services (IIS) through the network
connection of a desktop computer, you must install SQL Server CE Relay on the computer
Up One Level running ActiveSync. This is required both during application development and during
application deployment after development has been completed if the Windows CE-based
SQL Server CE Installation Overview devices do not have integrated network connectivity.

Hardware and Software Requirements


SQL Server CE Relay is installed automatically on the development computer when you
Upgrading from Earlier Versions of SQL Server CE install the development tools.

Installing SQL Server CE with Visual Studio .NET


Installing SQL Server CE with eMbedded Visual Tools Important Microsoft Windows Powered Pocket PC 2002-based
devices using ActiveSync 3.5 do not require SQL Server CE Relay,
Installing SQL Server CE with Platform Builder because this configuration supports Ethernet connectivity to and
from the device through the desktop computer.
Installing SQL Server CE on a Windows CE-based Device
Installing SQL Server CE on an IIS System
To set up SQL Server CE Relay on the computer running ActiveSync
Installing SQL Server CE on a SQL Server System
Using SQL Server CE Relay with an ActiveSync System
1. On the existing development computer, if you are using Microsoft eMbedded Visual Tools, navigate to the \Program
Installing SQL Server CE Query Analyzer Files\Microsoft SQL Server CE 2.0\Redist\Relay folder. If you are using Microsoft Visual Studio® .NET, navigate to
the \Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000 folder.
2. Copy Sscerelay.exe to any directory on the computer running ActiveSync.
3. Configure SQL Server CE Relay. For more information, see Using SQL Server CE Relay.

To remove SQL Server CE Relay from the computer running ActiveSync

SQL Server CE Relay is not installed using the setup process; therefore, you cannot use
Control Panel to add or remove it. You must remove Relay using a command prompt.

1. At the MS-DOS® command prompt, use the CD command to navigate to the location where you previously copied
and configured SQL Server CE Relay on the computer running ActiveSync. For example, type:

cd c:\Program Files\Microsoft SQL Server CE 2.0\Relay

2. To unregister SQL Server CE Relay, type:

Sscerelay /unregister

3. To delete Sscerelay.exe, type:

del sscerelay.exe

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...en-us/sqlce/htm/_lce_activesync_system_installation.asp [22/07/2004 04:52:44 p.m.]


Installing SQL Server CE Query Analyzer (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Installing SQL Server CE

SQL Server CE Books Online


Installing SQL Server CE Query Analyzer

SQL Server CE Query Analyzer is installed automatically if you are using Microsoft® Visual Studio® .NET, but requires manual installation if you are using
Microsoft eMbedded Visual Tools.

Visual Studio .NET

If you install Microsoft SQL Server™ 2000 Windows® CE Edition (SQL Server CE) with Visual Studio .NET, SQL Server CE Query Analyzer (Isqlw20.exe) is
placed on the development computer in C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\platform\processor.

SQL Server CE Query Analyzer is automatically installed on the device the first time you deploy an application (by selecting Start from the Debug menu
in Visual Studio .NET) that references the System.Data.SqlServerCe namespace. The default installation location is \Program Files\SQLCE2.0. A shortcut
to SQL Server CE Query Analyzer also appears on the Start menu of the device.

You can manually copy SQL Server CE Query Analyzer to the device by copying and extracting the following cab files from C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE to the root directory of the device: Netcf.cjk.platform.processor.cab,
Sqlce.platform.processor.cab, and Sqlce.dev.platform.processor.cab. A shortcut to SQL Server CE Query Analyzer appears in the Start menu of the
device.

eMbedded Visual Tools

If you install SQL Server CE with eMbedded Visual Tools, SQL Server CE Query Analyzer (Isqlw20.exe) is placed on the development computer in
C:\Program Files\Microsoft SQL Server CE 2.0\Device\processor family\processor type.

If SQL Server CE is not installed on the device:

1. Create a blank eMbedded Visual Basic project and include SQL Server CE in the project. On the Project menu, click References, Microsoft CE SQL Server Control 2.0, and then Microsoft CE ADO
Control 3.1.
2. Copy Ssce20.dll, Ssceca20.dll, Ssceerror20en.dll, Msdaeren.dll, Adoce31.dll, and Adoceoledb31.dll to the \Windows directory. For more information, see "Manual Installation Process" in Installing SQL
Server CE on a Device Using eMbedded Visual Tools.
3. After you have deployed an application referencing SQL Server CE or have manually installed the SQL Server CE files listed above, copy Isqlw20.exe to \Windows\Start Menu for Pocket PC devices or
\Windows\Desktop for Handheld PC 2000 devices.

To start SQL Server CE Query Analyzer, either select the application from the Start menu or tap the icon on the desktop.

See Also

Using SQL Server CE Query Analyzer

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_installing_query_analyzer_579.asp?frame=true [22/07/2004 04:52:51 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Installing SQL Server CE
Advanced Search

SQL Server CE Books Online


Installing SQL Server CE Query Analyzer

SQL Server CE Query Analyzer is installed automatically if you are using Microsoft® Visual
Studio® .NET, but requires manual installation if you are using Microsoft eMbedded Visual
Tools.

Up One Level
SQL Server CE Installation Overview Visual Studio .NET
Hardware and Software Requirements
Upgrading from Earlier Versions of SQL Server CE If you install Microsoft SQL Server™ 2000 Windows® CE Edition (SQL Server CE) with
Visual Studio .NET, SQL Server CE Query Analyzer (Isqlw20.exe) is placed on the
Installing SQL Server CE with Visual Studio .NET development computer in C:\Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE\platform\processor.
Installing SQL Server CE with eMbedded Visual Tools
Installing SQL Server CE with Platform Builder SQL Server CE Query Analyzer is automatically installed on the device the first time you
Installing SQL Server CE on a Windows CE-based Device deploy an application (by selecting Start from the Debug menu in Visual Studio .NET) that
references the System.Data.SqlServerCe namespace. The default installation location is
Installing SQL Server CE on an IIS System \Program Files\SQLCE2.0. A shortcut to SQL Server CE Query Analyzer also appears on the
Start menu of the device.
Installing SQL Server CE on a SQL Server System
Using SQL Server CE Relay with an ActiveSync System You can manually copy SQL Server CE Query Analyzer to the device by copying and
extracting the following cab files from C:\Program Files\Microsoft Visual Studio .NET
Installing SQL Server CE Query Analyzer 2003\CompactFrameworkSDK\v1.0.5000\Windows CE to the root directory of the device:
Netcf.cjk.platform.processor.cab, Sqlce.platform.processor.cab, and
Sqlce.dev.platform.processor.cab. A shortcut to SQL Server CE Query Analyzer appears in
the Start menu of the device.

eMbedded Visual Tools

If you install SQL Server CE with eMbedded Visual Tools, SQL Server CE Query Analyzer
(Isqlw20.exe) is placed on the development computer in C:\Program Files\Microsoft SQL
Server CE 2.0\Device\processor family\processor type.

If SQL Server CE is not installed on the device:

1. Create a blank eMbedded Visual Basic project and include SQL Server CE in the project. On the Project menu, click
References, Microsoft CE SQL Server Control 2.0, and then Microsoft CE ADO Control 3.1.
2. Copy Ssce20.dll, Ssceca20.dll, Ssceerror20en.dll, Msdaeren.dll, Adoce31.dll, and Adoceoledb31.dll to the \Windows
directory. For more information, see "Manual Installation Process" in Installing SQL Server CE on a Device Using
eMbedded Visual Tools.
3. After you have deployed an application referencing SQL Server CE or have manually installed the SQL Server CE
files listed above, copy Isqlw20.exe to \Windows\Start Menu for Pocket PC devices or \Windows\Desktop for
Handheld PC 2000 devices.

To start SQL Server CE Query Analyzer, either select the application from the Start menu or
tap the icon on the desktop.

See Also

Using SQL Server CE Query Analyzer

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr.../en-us/sqlce/htm/_lce_installing_query_analyzer_579.asp [22/07/2004 04:52:54 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0
MSDN Library Go
Advanced Search SQL Server CE Books Online
Configuring Security for Connectivity

After you install the necessary systems for Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE), you must configure the appropriate security and
connectivity options before any data can be exchanged by using replication or remote data access (RDA). The topics in this section describe the security and
connectivity requirements for SQL Server CE.

Up One Level Topic Description


Planning for Security Provides general information about security.
Planning for Security Configuring Connectivity Support in IIS Provides information about configuring connectivity support for replication and remote data access, including NTFS permissions

Configuring Connectivity Support in IIS requirements and advanced security configurations.

Using SQL Server CE Relay Provides information about installing and configuring SQL Server CE Relay when you are using Microsoft ActiveSync® 3.1.

Using SQL Server CE Relay


After connectivity support for replication and remote data access are properly configured, you are ready to use these connectivity solutions by enabling the
functionality in a Windows CE-based application. For more information, see Managing Connectivity and Building Applications.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_configuring_security_for_connectivity.asp [22/07/2004 04:54:17 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity
Advanced Search

SQL Server CE Books Online


Planning for Security

Connectivity between Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE)
and an instance of Microsoft SQL Server relies entirely upon properly configuring the
security models for both Microsoft Internet Information Services (IIS) and SQL Server.

Up One Level
In the SQL Server CE connectivity scenario, a Windows CE-based application initiates
IIS Security synchronization by invoking the appropriate SQL Server CE connectivity solution: either
replication or remote data access (RDA). Before accessing a SQL Server database using
SQL Server Security replication or RDA through HTTP, you must set up an IIS virtual directory that contains the
SQL Server CE Server Agent and configure the appropriate NTFS permissions. Configuring
IIS authentication and authorization specifies the clients that can invoke the SQL Server CE
Server Agent. Implementing this layer of security controls the clients that can perform
database synchronization or remote database access.

Note IIS can be configured to use Secure Sockets Layer (SSL)


encryption. This safeguards the data sent between the Windows CE-
based device and IIS when database synchronization or remote
database access is performed. For more information, see Configuring
SSL Encryption.

After the SQL Server CE Server Agent is invoked, it connects to an instance of SQL Server.
SQL Server authentication and authorization can be configured to control access to SQL
Server or SQL Server publications.

The following topics describe how IIS and SQL Server are configured to support security for
the SQL Server CE connectivity solutions (replication and RDA):

● IIS Security
● SQL Server Security

For more information about SQL Server CE database security, see Using the SQL Server CE
Database Security Features.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_planning_for_security.asp [22/07/2004 04:54:22 p.m.]


IIS Security (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Planning for Security

SQL Server CE Books Online


IIS Security

This topic describes how Microsoft® SQL Server® 2000 Windows® CE Edition (SQL Server CE) relies on:

● IIS Authentication
● IIS Authorization
● IIS Encryption

IIS Authentication

When you configure the SQL Server CE Server Agent, you specify whether clients must perform Microsoft Internet Information Services (IIS)
authentication when they connect to the SQL Server CE Server Agent. There are three forms of IIS authentication:

● Anonymous Access
● Basic Authentication
● Integrated Windows Authentication

It is expected that most Internet applications will use Basic authentication and Secure Sockets Layer (SSL) encryption.

Anonymous Access

With Anonymous access, IIS does not perform client authentication. All work that the SQL Server CE Server Agent performs on behalf of the client is
performed under the identity of the Internet Guest Account. By default, the Internet Guest Account is IUSR_computername, but you can designate some
other Windows user account as the Internet Guest Account.

Basic Authentication

With Basic authentication, the SQL Server CE client must supply a valid Windows account user name and password. IIS attempts to log in by using the
client-supplied user name and password. If the login attempt succeeds, all work that the SQL Server CE Server Agent performs is performed under the
identity of the specified Windows user account. If the login attempt fails, the request from the client is rejected. Basic authentication can be used for both
Internet and intranet applications. Basic authentication requires that each client have a valid Windows account with a corresponding user name and
password.

Important By default, Basic authentication passes the user name and password across the network in base64 encoding. This can
pose a security risk if anyone eavesdrops on the password exchange because the base64 encoding can easily be decoded. To
safeguard the user password, Secure Sockets Layer (SSL) encryption should always be used whenever Basic authentication is used.
For more information, see Configuring SSL Encryption.

Integrated Windows Authentication

Integrated Windows authentication works much like Basic authentication. The SQL Server CE client must supply a valid Windows account user name and
password. IIS attempts to log in using the user name and password. If the login attempt succeeds, all work that the SQL Server CE Server Agent performs
is performed under the identity of the Windows user account. If the login attempt fails, the client synchronization request is rejected. Integrated Windows
authentication has one primary advantage over Basic authentication: Unlike Basic authentication, Integrated Windows authentication does not transmit
the client's user name and password over the network in unencrypted form. This avoids the risk of someone intercepting the password. Integrated
Windows authentication is best suited to intranet applications. Integrated Windows authentication is seldom used for Internet applications because it
cannot operate over a proxy server or firewall.

Note Because Microsoft Windows CE 3.0 does not support Digest Authentication, Kerberos Authentication, and Client Certificate
Authentication, SQL Server CE connectivity solutions do not support these forms of authentication.

IIS Authorization

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_iis_security_533.asp?frame=true (1 of 2) [22/07/2004 04:54:26 p.m.]


IIS Security (SQL Server CE Books Online)

After the IIS client is authenticated, IIS authorization determines whether the client can invoke the SQL Server CE Server Agent. You control who can
perform SQL Server CE connectivity by controlling the clients that can access the SQL Server CE Server Agent.

IIS provides the following mechanisms for controlling access:

● IIS first checks the address of the client against any IP address restrictions that are configured. You can configure the Web server to prevent specific computers, groups of computers, or entire networks
from accessing the SQL Server CE Server Agent. When a client initially tries to access the SQL Server CE Server Agent, IIS checks the IP address of the client computer against the IP address restriction
settings on the server. If the IP address is denied access, the synchronization request from the client is rejected with the message: "403 Access Forbidden".
● If IIS is configured to require authentication, IIS checks whether the client has a valid Windows user account as described in IIS Authentication. If the user account is not valid, the client's synchronization
request is rejected with the message: "403 Access Forbidden".
● IIS next checks the Web permissions. This IIS security check is not relevant for SQL Server CE connectivity solutions.
● IIS then checks NTFS permissions for the SQL Server CE Server Agent to ensure the connecting user has appropriate permissions. For information about configuring the NTFS permissions required for SQL
Server CE applications using replication or RDA, see Configuring Connectivity Support in IIS and Configuring IIS and NTFS Permissions Manually.

Note Although IIS can also be used with a File Allocation Table (FAT) file system, it is strongly recommended that you
use NTFS. NTFS allows use of access control lists (ACLs) for granting or denying access to the SQL Server CE Server
Agent and the input and output message files on the IIS system.

IIS Encryption

When you configure the SQL Server CE Server Agent, you can specify SSL encryption. When you specify SSL encryption, all communication between the
SQL Server CE Client Agent and SQL Server CE Server Agent is encrypted. For more information, see Configuring SSL Encryption.

You should use SSL encryption in the following situations:

● If you configure IIS to use Basic authentication.

This is essential to safeguard the Internet password of the user. By default, Basic authentication transmits the user name and password across the network in base64 encoding. This can pose a security
risk if anyone eavesdrops on the password exchange because the base64 encoding can easily be decoded. SSL encryption should always be used whenever Basic authentication is used to safeguard the
user's Internet password.

● For RDA only: If the application specifies an OLEDBConnectionString parameter that contains a password.

The RDA Pull, Push, and SubmitSQL methods require an OLEDBConnectionString parameter. This connection string is passed across the network in clear text form. This can pose a security risk if anyone
eavesdrops on the password exchange.

● For replication only: If either the SQL Server Publisher or Distributor relies on SQL Server authentication.

The Distributor is using SQL Server authentication if the DistributorSecurityMode property specifies DB_AUTHENTICATION. The Publisher is using SQL Server authentication if the
PublisherSecurityMode property specifies DB_AUTHENTICATION. When SQL Server authentication is used, the DistributorPassword and PublisherPassword are passed across the network in clear
text form. This can pose a security risk if anyone eavesdrops on the password exchange. SSL encryption should always be used whenever SQL Server Authentication is used to safeguard
DistributorPassword and PublisherPassword.

See Also

Configuring IP Address and Domain Name Restrictions

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_iis_security_533.asp?frame=true (2 of 2) [22/07/2004 04:54:26 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Planning for Security
Advanced Search

SQL Server CE Books Online


IIS Security

This topic describes how Microsoft® SQL Server® 2000 Windows® CE Edition (SQL Server
CE) relies on:

Up One Level ● IIS Authentication


IIS Authorization
IIS Security

● IIS Encryption

SQL Server Security


IIS Authentication

When you configure the SQL Server CE Server Agent, you specify whether clients must
perform Microsoft Internet Information Services (IIS) authentication when they connect to
the SQL Server CE Server Agent. There are three forms of IIS authentication:

● Anonymous Access
● Basic Authentication
● Integrated Windows Authentication

It is expected that most Internet applications will use Basic authentication and Secure
Sockets Layer (SSL) encryption.

Anonymous Access

With Anonymous access, IIS does not perform client authentication. All work that the SQL
Server CE Server Agent performs on behalf of the client is performed under the identity of
the Internet Guest Account. By default, the Internet Guest Account is
IUSR_computername, but you can designate some other Windows user account as the
Internet Guest Account.

Basic Authentication

With Basic authentication, the SQL Server CE client must supply a valid Windows account
user name and password. IIS attempts to log in by using the client-supplied user name and
password. If the login attempt succeeds, all work that the SQL Server CE Server Agent
performs is performed under the identity of the specified Windows user account. If the login
attempt fails, the request from the client is rejected. Basic authentication can be used for
both Internet and intranet applications. Basic authentication requires that each client have a
valid Windows account with a corresponding user name and password.

Important By default, Basic authentication passes the user name


and password across the network in base64 encoding. This can pose
a security risk if anyone eavesdrops on the password exchange
because the base64 encoding can easily be decoded. To safeguard
the user password, Secure Sockets Layer (SSL) encryption should
always be used whenever Basic authentication is used. For more

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_iis_security_533.asp (1 of 3) [22/07/2004 04:54:29 p.m.]


Welcome to the MSDN Library

information, see Configuring SSL Encryption.

Integrated Windows Authentication

Integrated Windows authentication works much like Basic authentication. The SQL Server
CE client must supply a valid Windows account user name and password. IIS attempts to
log in using the user name and password. If the login attempt succeeds, all work that the
SQL Server CE Server Agent performs is performed under the identity of the Windows user
account. If the login attempt fails, the client synchronization request is rejected. Integrated
Windows authentication has one primary advantage over Basic authentication: Unlike Basic
authentication, Integrated Windows authentication does not transmit the client's user name
and password over the network in unencrypted form. This avoids the risk of someone
intercepting the password. Integrated Windows authentication is best suited to intranet
applications. Integrated Windows authentication is seldom used for Internet applications
because it cannot operate over a proxy server or firewall.

Note Because Microsoft Windows CE 3.0 does not support Digest


Authentication, Kerberos Authentication, and Client Certificate
Authentication, SQL Server CE connectivity solutions do not support
these forms of authentication.

IIS Authorization

After the IIS client is authenticated, IIS authorization determines whether the client can
invoke the SQL Server CE Server Agent. You control who can perform SQL Server CE
connectivity by controlling the clients that can access the SQL Server CE Server Agent.

IIS provides the following mechanisms for controlling access:

● IIS first checks the address of the client against any IP address restrictions that are configured. You can configure
the Web server to prevent specific computers, groups of computers, or entire networks from accessing the SQL
Server CE Server Agent. When a client initially tries to access the SQL Server CE Server Agent, IIS checks the IP
address of the client computer against the IP address restriction settings on the server. If the IP address is denied
access, the synchronization request from the client is rejected with the message: "403 Access Forbidden".
● If IIS is configured to require authentication, IIS checks whether the client has a valid Windows user account as
described in IIS Authentication. If the user account is not valid, the client's synchronization request is rejected with
the message: "403 Access Forbidden".
● IIS next checks the Web permissions. This IIS security check is not relevant for SQL Server CE connectivity
solutions.
● IIS then checks NTFS permissions for the SQL Server CE Server Agent to ensure the connecting user has
appropriate permissions. For information about configuring the NTFS permissions required for SQL Server CE
applications using replication or RDA, see Configuring Connectivity Support in IIS and Configuring IIS and NTFS
Permissions Manually.

Note Although IIS can also be used with a File Allocation


Table (FAT) file system, it is strongly recommended that
you use NTFS. NTFS allows use of access control lists
(ACLs) for granting or denying access to the SQL Server
CE Server Agent and the input and output message files
on the IIS system.

IIS Encryption

When you configure the SQL Server CE Server Agent, you can specify SSL encryption. When
you specify SSL encryption, all communication between the SQL Server CE Client Agent and
SQL Server CE Server Agent is encrypted. For more information, see Configuring SSL
Encryption.

You should use SSL encryption in the following situations:

● If you configure IIS to use Basic authentication.

This is essential to safeguard the Internet password of the user. By default, Basic authentication transmits the user
name and password across the network in base64 encoding. This can pose a security risk if anyone eavesdrops on
the password exchange because the base64 encoding can easily be decoded. SSL encryption should always be
used whenever Basic authentication is used to safeguard the user's Internet password.

● For RDA only: If the application specifies an OLEDBConnectionString parameter that contains a password.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_iis_security_533.asp (2 of 3) [22/07/2004 04:54:29 p.m.]


Welcome to the MSDN Library

The RDA Pull, Push, and SubmitSQL methods require an OLEDBConnectionString parameter. This connection
string is passed across the network in clear text form. This can pose a security risk if anyone eavesdrops on the
password exchange.

● For replication only: If either the SQL Server Publisher or Distributor relies on SQL Server authentication.

The Distributor is using SQL Server authentication if the DistributorSecurityMode property specifies
DB_AUTHENTICATION. The Publisher is using SQL Server authentication if the PublisherSecurityMode property
specifies DB_AUTHENTICATION. When SQL Server authentication is used, the DistributorPassword and
PublisherPassword are passed across the network in clear text form. This can pose a security risk if anyone
eavesdrops on the password exchange. SSL encryption should always be used whenever SQL Server Authentication
is used to safeguard DistributorPassword and PublisherPassword.

See Also

Configuring IP Address and Domain Name Restrictions

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_iis_security_533.asp (3 of 3) [22/07/2004 04:54:29 p.m.]


SQL Server Security (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Planning for Security

SQL Server CE Books Online


SQL Server Security

This topic describes how Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) works with:

● SQL Server Authentication


● SQL Server Authorization

SQL Server Authentication

SQL Server supports two forms of authentication:

● Windows Authentication
● SQL Server Authentication

Windows Authentication

When Windows authentication is used to connect to SQL Server, Microsoft Windows is entirely responsible for authenticating the client. In this case, the
client is identified by its Windows user account. In the case of SQL Server CE replication or remote data access (RDA), the SQL Server CE Server Agent
acts as the database client, running under the identity of a Windows user account:

● When IIS is configured to use Anonymous access, the SQL Server CE Server Agent runs under the identity of the Internet Guest Account, by default IUSR_computername. If you configure another
Windows user account as the IIS anonymous user account, the SQL Server CE Server Agent runs under the identity of that account.
● When IIS is configured to use Basic authentication, the SQL Server CE Server Agent runs under the identity of the Windows user account for which the client supplied the Internet user name and password.
● When IIS is configured to use Integrated Windows authentication, the SQL Server CE Server Agent runs under the identity of the client.

SQL Server Authentication

When SQL Server authentication is used, SQL Server authenticates the client by comparing the client-supplied user name and password to the list of valid
user names and passwords maintained within SQL Server. In this case, the Windows CE-based application must supply the appropriate SQL Server login
and password when connecting to SQL Server using replication or remote data access. The SQL Server CE Client Agent conveys the login and password to
the SQL Server CE Server Agent. The SQL Server CE Server Agent invokes SQL Server using the login and password specified by the client.

SQL Server Authorization

When a client is successfully authenticated, the user or group name of the client is mapped to a SQL Server user account.

The client must have a user account in each database that it wants to access. The user account is used to control access to the tables, views, stored
procedures, and so on, in that database. The activities that a client can perform are controlled by the permissions applied to the user account through
which the client gained access to the database.

For RDA only: You can precisely control the database operations that RDA clients can perform by the permissions you grant them.

For replication only: When you create a publication, SQL Server creates a publication access list (PAL) for the publication. You must update the PAL to
grant access to the publication. For more information, see Configuring the Publication Access List.

When you create a publication, the location of the snapshot folder is specified. The snapshot folder is used when a subscription is initially created or
reinitialized. If the computer running SQL Server is located on a NTFS system, the appropriate NTFS permissions must be specified. For more information,
see Configuring the Snapshot Folder.

When you create a publication, you can use the Check Permissions option to provide an enhanced level of security to the publication. The Check
Permissions option ensures that the Merge Agent has the authority to upload data changes to a Publisher. When you specify this option, SQL Server
verifies that the Merge Agent login has the permissions to perform INSERT, UPDATE, and DELETE statements on the publication database. For more

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_sql_server_security_705.asp?frame=true (1 of 2) [22/07/2004 04:54:33 p.m.]


SQL Server Security (SQL Server CE Books Online)

information, see Configuring the Check Permissions Option.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_sql_server_security_705.asp?frame=true (2 of 2) [22/07/2004 04:54:33 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Planning for Security
Advanced Search

SQL Server CE Books Online


SQL Server Security

This topic describes how Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE) works with:

Up One Level ● SQL Server Authentication


SQL Server Authorization
IIS Security

SQL Server Security


SQL Server Authentication

SQL Server supports two forms of authentication:

● Windows Authentication
● SQL Server Authentication

Windows Authentication

When Windows authentication is used to connect to SQL Server, Microsoft Windows is


entirely responsible for authenticating the client. In this case, the client is identified by its
Windows user account. In the case of SQL Server CE replication or remote data access
(RDA), the SQL Server CE Server Agent acts as the database client, running under the
identity of a Windows user account:

● When IIS is configured to use Anonymous access, the SQL Server CE Server Agent runs under the identity of the
Internet Guest Account, by default IUSR_computername. If you configure another Windows user account as the
IIS anonymous user account, the SQL Server CE Server Agent runs under the identity of that account.
● When IIS is configured to use Basic authentication, the SQL Server CE Server Agent runs under the identity of the
Windows user account for which the client supplied the Internet user name and password.
● When IIS is configured to use Integrated Windows authentication, the SQL Server CE Server Agent runs under the
identity of the client.

SQL Server Authentication

When SQL Server authentication is used, SQL Server authenticates the client by comparing
the client-supplied user name and password to the list of valid user names and passwords
maintained within SQL Server. In this case, the Windows CE-based application must supply
the appropriate SQL Server login and password when connecting to SQL Server using
replication or remote data access. The SQL Server CE Client Agent conveys the login and
password to the SQL Server CE Server Agent. The SQL Server CE Server Agent invokes SQL
Server using the login and password specified by the client.

SQL Server Authorization

When a client is successfully authenticated, the user or group name of the client is mapped
to a SQL Server user account.

http://msdn.microsoft.com/library/default.asp?url=/...ry/en-us/sqlce/htm/_lce_sql_server_security_705.asp (1 of 2) [22/07/2004 04:54:36 p.m.]


Welcome to the MSDN Library

The client must have a user account in each database that it wants to access. The user
account is used to control access to the tables, views, stored procedures, and so on, in that
database. The activities that a client can perform are controlled by the permissions applied
to the user account through which the client gained access to the database.

For RDA only: You can precisely control the database operations that RDA clients can
perform by the permissions you grant them.

For replication only: When you create a publication, SQL Server creates a publication
access list (PAL) for the publication. You must update the PAL to grant access to the
publication. For more information, see Configuring the Publication Access List.

When you create a publication, the location of the snapshot folder is specified. The snapshot
folder is used when a subscription is initially created or reinitialized. If the computer running
SQL Server is located on a NTFS system, the appropriate NTFS permissions must be
specified. For more information, see Configuring the Snapshot Folder.

When you create a publication, you can use the Check Permissions option to provide an
enhanced level of security to the publication. The Check Permissions option ensures that
the Merge Agent has the authority to upload data changes to a Publisher. When you specify
this option, SQL Server verifies that the Merge Agent login has the permissions to perform
INSERT, UPDATE, and DELETE statements on the publication database. For more
information, see Configuring the Check Permissions Option.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...ry/en-us/sqlce/htm/_lce_sql_server_security_705.asp (2 of 2) [22/07/2004 04:54:36 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity
Advanced Search

SQL Server CE Books Online


Configuring Connectivity Support in IIS

Before you can access a database in Microsoft® SQL Server™ by using replication or remote
data access (RDA) through HTTP, you must set up a virtual directory and configure the
appropriate NTFS permissions. Microsoft SQL Server 2000 Windows® CE Edition (SQL
Server CE) provides the SQL Server CE Connectivity Management utility to create and
Up One Level manage virtual directories and NTFS permissions.

Using Connectivity Tools


The following topics in this section describe using the SQL Server CE Connectivity
Advanced Security Configurations Management utility for connectivity support and setting advanced configuration options:

● Using Connectivity Tools


● Advanced Security Configurations

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...tm/_lce_configuring_connectivity_support_in_iis_705.asp [22/07/2004 04:54:49 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS
Advanced Search

SQL Server CE Books Online


Using Connectivity Tools

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides the SQL
Server CE Connectivity Management utility to configure Microsoft Internet Information
Services (IIS) and setup appropriate NTFS permissions. The SQL Server CE Connectivity
Management utility contains the SQL Server CE Virtual Directory Creation Wizard for
Up One Level creating new virtual directories and a management console for managing existing virtual
directories. The SQL Server CE Connectivity Management utility is a standard Microsoft
Creating a New Virtual Directory Management Console (MMC) snap-in.

Modifying an Existing Virtual Directory


The SQL Server CE Connectivity Management utility and the SQL Server CE Virtual Directory
Virtual Directory Recommendations and Default Settings Creation Wizard are installed automatically either by selecting the Server Tools option
during SQL Server CE setup or by running the Server Tools self-extracting executable on
the computer running IIS. For more information about installing Server Tools, see Installing
SQL Server CE on an IIS System.

Note At the end of the SQL Server CE setup process, you can
choose to launch the SQL Server CE Virtual Directory Creation
Wizard immediately.

To start the SQL Server CE Connectivity Management utility on the computer


running IIS

● On the Start menu, point to Programs, Microsoft SQL Server CE, and then click Configure Connectivity
Support in IIS.

Or

● Right-click the My Computer icon, and then click Manage. In the Computer Management window, expand
Services and Applications, and then click Microsoft SQL Server CE.

To start the SQL Server CE Virtual Directory Creation Wizard

If you are configuring connectivity for the first time and did not run the SQL Server CE
Virtual Directory Creation Wizard at the end of setup, you can start the wizard from the SQL
Server CE Connectivity Management utility.

● In the right pane of the utility, double-click Create a Virtual Directory. For more information, see Creating a New
Virtual Directory.

Important IIS must be installed and running to start the SQL


Server CE Connectivity Management utility or the SQL Server CE
Virtual Directory Creation Wizard.

For information about using the SQL Server CE Connectivity Management utility to manage
existing virtual directories, see Modifying an Existing Virtual Directory.

See Also

Planning for Security

Managing Connectivity

http://msdn.microsoft.com/library/default.asp?url=/...lce/htm/_lce_configuring_connectivity_tools_533.asp (1 of 2) [22/07/2004 04:54:54 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...lce/htm/_lce_configuring_connectivity_tools_533.asp (2 of 2) [22/07/2004 04:54:54 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools

SQL Server CE Books Online

Creating a New Virtual


Directory
Up One Level
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) relies on Microsoft
Virtual Directory Alias and Content Folder Internet Information Services (IIS) virtual directories to access data from a database in
Microsoft SQL Server. To create a virtual directory, SQL Server CE provides the SQL Server
Virtual Directory Authentication CE Virtual Directory Creation Wizard, which contains the following pages to guide you
through the process:
NTFS Permissions: User
NTFS Permissions: Computer Running SQL Server ● Virtual Directory Alias and Content Folder

NTFS Permissions: Snapshot Folder ●


Virtual Directory Authentication
NTFS Permissions: User
● NTFS Permissions: Computer Running SQL Server
● NTFS Permissions: Snapshot Folder

See Also

Planning for Security

Managing Connectivity

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...sqlce/htm/_lce_creating_a_new_virtual_directory_533.asp [22/07/2004 04:55:02 p.m.]


Virtual Directory Alias and Content Folder (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Creating a
New Virtual Directory

SQL Server CE Books Online

Virtual Directory Alias and Content Folder


This page of the SQL Server CE Virtual Directory Creation Wizard allows you to create an alias and content folder for the virtual directory.

Virtual Directory Alias

For quick reference, you can create an alias for the virtual directory. It is recommended that you use the same naming conventions that you use for a
folder.

The name of the server running Microsoft® Internet Information Services (IIS), the virtual directory, and the SQL Server CE Server Agent (Sscesa20.dll)
must be specified as part of the InternetURL property for connectivity. For example, the following URL accesses a SQL Server CE Server Agent for
replication or remote data access (RDA): http://www.northwindtraders.com/sqlce/sscesa20.dll.

Virtual Directory Content Folder

A content folder is required for a virtual directory. By default, the wizard points to the location in which the SQL Server CE Server Agent is installed. You
can specify an alternate location on disk for better disk space management, although a copy of the SQL Server CE Server Agent must be located in that
location. If you do specify an alternate location, the wizard can copy and register the SQL Server CE Server Agent to the new location. All temporary files
for data transfer to and from the instance of Microsoft SQL Server™ will reside in this location.

After the wizard successfully completes, HTTP Execute permissions on the content folder will be added.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...l_directory_alias_and_content_fold_579.asp?frame=true [22/07/2004 04:55:06 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Creating a New Virtual Directory

SQL Server CE Books Online

Virtual Directory Alias and


Content Folder
Up One Level
This page of the SQL Server CE Virtual Directory Creation Wizard allows you to create an
Virtual Directory Alias and Content Folder alias and content folder for the virtual directory.

Virtual Directory Authentication


NTFS Permissions: User Virtual Directory Alias
NTFS Permissions: Computer Running SQL Server
NTFS Permissions: Snapshot Folder For quick reference, you can create an alias for the virtual directory. It is recommended that
you use the same naming conventions that you use for a folder.

The name of the server running Microsoft® Internet Information Services (IIS), the virtual
directory, and the SQL Server CE Server Agent (Sscesa20.dll) must be specified as part of
the InternetURL property for connectivity. For example, the following URL accesses a SQL
Server CE Server Agent for replication or remote data access (RDA):
http://www.northwindtraders.com/sqlce/sscesa20.dll.

Virtual Directory Content Folder

A content folder is required for a virtual directory. By default, the wizard points to the
location in which the SQL Server CE Server Agent is installed. You can specify an alternate
location on disk for better disk space management, although a copy of the SQL Server CE
Server Agent must be located in that location. If you do specify an alternate location, the
wizard can copy and register the SQL Server CE Server Agent to the new location. All
temporary files for data transfer to and from the instance of Microsoft SQL Server™ will
reside in this location.

After the wizard successfully completes, HTTP Execute permissions on the content folder will
be added.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...m/_lce_virtual_directory_alias_and_content_fold_579.asp [22/07/2004 04:55:09 p.m.]


Virtual Directory Authentication (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Creating a
New Virtual Directory

SQL Server CE Books Online

Virtual Directory Authentication


After you specify the virtual directory alias, create the virtual directory content folder and set the appropriate HTTP permissions. You must set access
rights (authentication) to that folder. The SQL Server CE Virtual Directory Creation Wizard provides three authentication options:

● Anonymous access
● Basic authentication
● Integrated Windows authentication

For more information about these options, see IIS Security.

Additional Authentication Guidelines

● If you specify Anonymous access and the instances of Microsoft® Internet Information Services (IIS) and Microsoft SQL Server™ are located on different computers, you must configure the IIS anonymous
user account as a domain user account. The default anonymous user computername\IUSR_computername cannot be used because it is a local account for a computer.

Note When Anonymous access is selected, the anonymous user (by default computername\IUSR_computername) is
automatically provided the appropriate NTFS permission rights to the computer running IIS. Read and Write access
permissions are set on the content folder and Read & Execute access permission is set on the SQL Server CE Server
Agent (Sscesa20.dll).

● If you specify Basic authentication, you should also use IIS to specify Secure Sockets Layer (SSL) encryption to avoid transmitting the password of the user across the network in unencrypted form.

Important To safeguard the user password, SSL encryption should always be used whenever Basic authentication is
used. For more information, see Configuring SSL Encryption.

● If you specify Integrated Windows authentication, you cannot operate over a proxy server or firewall. As a result, Integrated Windows authentication can be used for intranet applications but is seldom, if
ever, used for Internet applications.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_virtual_directory_authentication_289.asp?frame=true [22/07/2004 04:55:13 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Creating a New Virtual Directory

SQL Server CE Books Online

Virtual Directory
Authentication
Up One Level
After you specify the virtual directory alias, create the virtual directory content folder and
Virtual Directory Alias and Content Folder set the appropriate HTTP permissions. You must set access rights (authentication) to that
folder. The SQL Server CE Virtual Directory Creation Wizard provides three authentication
Virtual Directory Authentication options:

NTFS Permissions: User


NTFS Permissions: Computer Running SQL Server ●


Anonymous access
Basic authentication
Integrated Windows authentication
NTFS Permissions: Snapshot Folder

For more information about these options, see IIS Security.

Additional Authentication Guidelines

● If you specify Anonymous access and the instances of Microsoft® Internet Information Services (IIS) and Microsoft
SQL Server™ are located on different computers, you must configure the IIS anonymous user account as a domain
user account. The default anonymous user computername\IUSR_computername cannot be used because it is a
local account for a computer.

Note When Anonymous access is selected, the


anonymous user (by default
computername\IUSR_computername) is automatically
provided the appropriate NTFS permission rights to the
computer running IIS. Read and Write access permissions
are set on the content folder and Read & Execute access
permission is set on the SQL Server CE Server Agent
(Sscesa20.dll).

● If you specify Basic authentication, you should also use IIS to specify Secure Sockets Layer (SSL) encryption to
avoid transmitting the password of the user across the network in unencrypted form.

Important To safeguard the user password, SSL


encryption should always be used whenever Basic
authentication is used. For more information, see
Configuring SSL Encryption.

● If you specify Integrated Windows authentication, you cannot operate over a proxy server or firewall. As a result,
Integrated Windows authentication can be used for intranet applications but is seldom, if ever, used for Internet
applications.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libra.../sqlce/htm/_lce_virtual_directory_authentication_289.asp [22/07/2004 04:55:16 p.m.]


NTFS Permissions: User (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Creating a
New Virtual Directory

SQL Server CE Books Online

NTFS Permissions: User


After Microsoft® Internet Information Services (IIS) authenticates the client, IIS checks whether the client is authorized to begin replication or remote
data access (RDA). You control which clients can invoke replication or RDA by setting NTFS permissions on the SQL Server CE Server Agent and content
folder. Proper configuration of permissions is crucial to prevent unauthorized access to Microsoft SQL Server™ by using replication or RDA.

You must add NTFS permissions if either or both of the following states exist:

● The computer running IIS uses NTFS.


● The SQL Server CE-based application uses replication; and the snapshot folder, usually located on the computer running SQL Server, exists on an NTFS drive partition.

When you create a new virtual directory, the SQL Server CE Virtual Directory Creation Wizard helps you configure NTFS permissions. In addition, to edit
an existing directory, you can use the NTFS Permissions tab of the SQL Server CE Connectivity Management utility to add or modify NTFS permissions.

Note When using the SQL Server CE Virtual Directory Creation Wizard, after you specify the user, the appropriate NTFS
permissions are set automatically for the computer running IIS.

Additional Permissions Guidelines

● When Basic or Integrated Windows authentication is selected, you must specify the name of the user that requires NTFS permissions.
● When Anonymous access is selected, the Internet Guest Account (by default computername\IUSR_computername) is used automatically.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_ntfs_access_permissions58_user_301.asp?frame=true [22/07/2004 04:55:25 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Creating a New Virtual Directory

SQL Server CE Books Online

NTFS Permissions: User


After Microsoft® Internet Information Services (IIS) authenticates the client, IIS checks
whether the client is authorized to begin replication or remote data access (RDA). You
Up One Level control which clients can invoke replication or RDA by setting NTFS permissions on the SQL
Server CE Server Agent and content folder. Proper configuration of permissions is crucial to
Virtual Directory Alias and Content Folder prevent unauthorized access to Microsoft SQL Server™ by using replication or RDA.

Virtual Directory Authentication


NTFS Permissions: User You must add NTFS permissions if either or both of the following states exist:

NTFS Permissions: Computer Running SQL Server


NTFS Permissions: Snapshot Folder ●


The computer running IIS uses NTFS.
The SQL Server CE-based application uses replication; and the snapshot folder, usually located on the computer
running SQL Server, exists on an NTFS drive partition.

When you create a new virtual directory, the SQL Server CE Virtual Directory Creation
Wizard helps you configure NTFS permissions. In addition, to edit an existing directory, you
can use the NTFS Permissions tab of the SQL Server CE Connectivity Management utility
to add or modify NTFS permissions.

Note When using the SQL Server CE Virtual Directory Creation


Wizard, after you specify the user, the appropriate NTFS permissions
are set automatically for the computer running IIS.

Additional Permissions Guidelines

● When Basic or Integrated Windows authentication is selected, you must specify the name of the user that requires
NTFS permissions.
● When Anonymous access is selected, the Internet Guest Account (by default
computername\IUSR_computername) is used automatically.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../sqlce/htm/_lce_ntfs_access_permissions58_user_301.asp [22/07/2004 04:55:28 p.m.]


NTFS Permissions: Computer Running SQL Server (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Creating a
New Virtual Directory

SQL Server CE Books Online

NTFS Permissions: Computer Running SQL Server


If your application uses replication, you must set NTFS Read permission on the actual snapshot folder and the share. Most commonly, the snapshot folder
is located on the computer running Microsoft® SQL Server™.

Select the check box on this screen of the SQL Server CE Virtual Directory Creation Wizard or the NTFS Permissions Wizard, if either of these states exists:

● A snapshot share has already been created and specified during the configuration of the SQL Server Distributor.
● The snapshot share has been created and will be specified when the SQL Server Distributor is configured.

Note A folder or share cannot be created using the SQL Server CE Connectivity Management utility or the SQL Server
CE Virtual Directory Creation Wizard.

The configuration step to give the appropriate user Read permission to the snapshot folder and share can be completed at a later time by using the NTFS
Permissions Wizard. To start the NTFS Permissions Wizard, on the NTFS Permissions tab of the SQL Server CE Connectivity Management utility, click
Add/Modify NTFS Permissions for User, or use Microsoft Windows® Explorer.

For more information about snapshot folders, see Configuring the Snapshot Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...cess_permissions58_computer_runni_774.asp?frame=true [22/07/2004 04:55:33 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Creating a New Virtual Directory

SQL Server CE Books Online

NTFS Permissions: Computer


Running SQL Server
Up One Level
If your application uses replication, you must set NTFS Read permission on the actual
Virtual Directory Alias and Content Folder snapshot folder and the share. Most commonly, the snapshot folder is located on the
computer running Microsoft® SQL Server™.
Virtual Directory Authentication
NTFS Permissions: User Select the check box on this screen of the SQL Server CE Virtual Directory Creation Wizard
NTFS Permissions: Computer Running SQL Server or the NTFS Permissions Wizard, if either of these states exists:

NTFS Permissions: Snapshot Folder


● A snapshot share has already been created and specified during the configuration of the SQL Server Distributor.
● The snapshot share has been created and will be specified when the SQL Server Distributor is configured.

Note A folder or share cannot be created using the SQL


Server CE Connectivity Management utility or the SQL
Server CE Virtual Directory Creation Wizard.

The configuration step to give the appropriate user Read permission to the snapshot folder
and share can be completed at a later time by using the NTFS Permissions Wizard. To start
the NTFS Permissions Wizard, on the NTFS Permissions tab of the SQL Server CE
Connectivity Management utility, click Add/Modify NTFS Permissions for User, or use
Microsoft Windows® Explorer.

For more information about snapshot folders, see Configuring the Snapshot Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li..._lce_ntfs_access_permissions58_computer_runni_774.asp [22/07/2004 04:55:36 p.m.]


NTFS Permissions: Snapshot Folder (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Creating a
New Virtual Directory

SQL Server CE Books Online

NTFS Permissions: Snapshot Folder


The snapshot share must be specified as a Universal Naming Convention (UNC) path. Depending on the Virtual Directory Authentication that has been
selected, the appropriate Microsoft® Windows® user account requires Read permission on the snapshot share and underlined folder. For more
information, see NTFS Permissions: User. The SQL Server CE Virtual Directory Creation Wizard and the SQL Server CE Connectivity Management utility
can configure only one user at a time. If you want to configure multiple users at the same time, use Windows Explorer.

Note When using the SQL Server CE Virtual Directory Creation Wizard, after you specify the snapshot folder share and click
Finish, the appropriate NTFS permission are automatically set for the snapshot folder.

For more information about snapshot folders, see Configuring the Snapshot Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...ccess_permissions58_snapshot_folde_14.asp?frame=true [22/07/2004 04:55:46 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Creating a New Virtual Directory

SQL Server CE Books Online

NTFS Permissions: Snapshot


Folder
Up One Level
The snapshot share must be specified as a Universal Naming Convention (UNC) path.
Virtual Directory Alias and Content Folder Depending on the Virtual Directory Authentication that has been selected, the appropriate
Microsoft® Windows® user account requires Read permission on the snapshot share and
Virtual Directory Authentication underlined folder. For more information, see NTFS Permissions: User. The SQL Server CE
Virtual Directory Creation Wizard and the SQL Server CE Connectivity Management utility
NTFS Permissions: User can configure only one user at a time. If you want to configure multiple users at the same
time, use Windows Explorer.
NTFS Permissions: Computer Running SQL Server
NTFS Permissions: Snapshot Folder
Note When using the SQL Server CE Virtual Directory Creation
Wizard, after you specify the snapshot folder share and click Finish,
the appropriate NTFS permission are automatically set for the
snapshot folder.

For more information about snapshot folders, see Configuring the Snapshot Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li.../_lce_ntfs_access_permissions58_snapshot_folde_14.asp [22/07/2004 04:55:49 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools

SQL Server CE Books Online

Modifying an Existing Virtual


Directory
Up One Level
You can use the SQL Server CE Connectivity Management utility to modify an existing
Virtual Directory Content Folder (HTTP Content Folder Tab) virtual directory. To modify an existing configuration, select the appropriate virtual directory
from the list in the left pane of the SQL Server CE Connectivity Management utility, and
Virtual Directory Authentication (HTTP Authentication Tab) then modify the settings shown in the right pane by using the following tabs:

NTFS Permissions (NTFS Permissions Tab)


● Virtual Directory Content Folder (HTTP Content Folder Tab)
● Virtual Directory Authentication (HTTP Authentication Tab)
● NTFS Permissions (NTFS Permissions Tab)

See Also

Virtual Directory Recommendations and Default Settings

Advanced Security Configurations

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...tm/_lce_modifying_an_existing_virtual_directory_705.asp [22/07/2004 04:55:58 p.m.]


Virtual Directory Content Folder (HTTP Content Folder Tab) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Modifying
an Existing Virtual Directory

SQL Server CE Books Online

Virtual Directory Content Folder (HTTP Content


Folder Tab)
Use this tab of the SQL Server CE Connectivity Management utility to modify the content folder associated with an existing virtual directory and/or to alter
the HTTP permissions to the folder. Enter the full path to the content folder associated with the virtual directory (for example, C:\Program Files\Microsoft
SQL Server CE 2.0\Server) or click Browse to find the folder on the local computer. Specify the HTTP permissions to the folder. Execute permission is
required by SQL Server CE. It is not advised to add Write permission to this location.

If the content folder is changed, you must run the NTFS Permissions Wizard to set NTFS permissions on the new location. To start the NTFS Permission
Wizard, on the NTFS Permissions tab of the SQL Server CE Connectivity Management utility, click Add/Modify NTFS Permissions for User.

For more information, see Virtual Directory Alias and Content Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...l_directory_content_folder_40http__760.asp?frame=true [22/07/2004 04:56:04 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Modifying an Existing Virtual Directory

SQL Server CE Books Online

Virtual Directory Content


Folder (HTTP Content Folder
Up One Level Tab)
Virtual Directory Content Folder (HTTP Content Folder Tab)
Virtual Directory Authentication (HTTP Authentication Tab) Use this tab of the SQL Server CE Connectivity Management utility to modify the content
folder associated with an existing virtual directory and/or to alter the HTTP permissions to
NTFS Permissions (NTFS Permissions Tab) the folder. Enter the full path to the content folder associated with the virtual directory (for
example, C:\Program Files\Microsoft SQL Server CE 2.0\Server) or click Browse to find the
folder on the local computer. Specify the HTTP permissions to the folder. Execute
permission is required by SQL Server CE. It is not advised to add Write permission to this
location.

If the content folder is changed, you must run the NTFS Permissions Wizard to set NTFS
permissions on the new location. To start the NTFS Permission Wizard, on the NTFS
Permissions tab of the SQL Server CE Connectivity Management utility, click Add/Modify
NTFS Permissions for User.

For more information, see Virtual Directory Alias and Content Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...m/_lce_virtual_directory_content_folder_40http__760.asp [22/07/2004 04:56:06 p.m.]


Virtual Directory Authentication (HTTP Authentication Tab) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Modifying
an Existing Virtual Directory

SQL Server CE Books Online

Virtual Directory Authentication (HTTP


Authentication Tab)
Use this tab of the SQL Server CE Connectivity Management utility to modify HTTP authentication of an existing virtual directory. If the HTTP
authentication is changed, you must run the NTFS Permissions Wizard to set NTFS permissions for the new user. To start the NTFS Permissions Wizard, on
the NTFS Permissions tab of the SQL Server CE Connectivity Management utility, click Add/Modify NTFS Permissions for User.

The SQL Server CE Connectivity Management utility provides three authentication options:

● Anonymous access
● Basic authentication
● Integrated Windows authentication

Important By default, Basic authentication passes the user name and password across the network. To safeguard the user
password, Secure Sockets Layer (SSL) encryption should always be used whenever Basic authentication is used. For more
information, see Configuring SSL Encryption.

For more information about these options, see Virtual Directory Authentication and IIS Security.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce...al_directory_authentication_40http__814.asp?frame=true [22/07/2004 04:56:11 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Modifying an Existing Virtual Directory

SQL Server CE Books Online

Virtual Directory
Authentication (HTTP
Up One Level Authentication Tab)
Virtual Directory Content Folder (HTTP Content Folder Tab)
Virtual Directory Authentication (HTTP Authentication Tab) Use this tab of the SQL Server CE Connectivity Management utility to modify HTTP
authentication of an existing virtual directory. If the HTTP authentication is changed, you
NTFS Permissions (NTFS Permissions Tab) must run the NTFS Permissions Wizard to set NTFS permissions for the new user. To start
the NTFS Permissions Wizard, on the NTFS Permissions tab of the SQL Server CE
Connectivity Management utility, click Add/Modify NTFS Permissions for User.

The SQL Server CE Connectivity Management utility provides three authentication options:

● Anonymous access
● Basic authentication
● Integrated Windows authentication

Important By default, Basic authentication passes the user name


and password across the network. To safeguard the user password,
Secure Sockets Layer (SSL) encryption should always be used
whenever Basic authentication is used. For more information, see
Configuring SSL Encryption.

For more information about these options, see Virtual Directory Authentication and IIS
Security.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...m/_lce_virtual_directory_authentication_40http__814.asp [22/07/2004 04:56:14 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Modifying an Existing Virtual Directory

SQL Server CE Books Online

NTFS Permissions (NTFS


Permissions Tab)
Up One Level
Use this tab of the SQL Server CE Connectivity Management utility to start the NTFS
NTFS Permissions: Computer Running IIS Permissions Wizard. Use the NTFS Permissions Wizard to modify NTFS Permissions on the
computer running Microsoft® Internet Information Services (IIS) or the computer running
NTFS Permissions: Snapshot Folder Access Microsoft SQL Server™. The NTFS Permissions Wizards contains the following pages:

● NTFS Permissions: User

This page in the NTFS Permissions Wizard is functionally identical to the NTFS Permissions: User page in the SQL
Server CE Virtual Directory Creation Wizard.

● NTFS Permissions: Computer Running IIS


● NTFS Permissions: Computer Running SQL Server

This page in the NTFS Permissions Wizard is functionally identical to the NTFS Permissions: Computer Running SQL
Server page in the SQL Server CE Virtual Directory Creation Wizard.

● NTFS Permissions: Snapshot Folder

This page in the NTFS Permissions Wizard is functionally identical to the NTFS Permissions: Snapshot Folder page
SQL Server CE Virtual Directory Creation Wizard.

● NTFS Permissions: Snapshot Folder Access

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../_lce_ntfs_access_permissions_40ntfs_permissio_709.asp [22/07/2004 04:56:20 p.m.]


NTFS Permissions: Computer Running IIS (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Modifying
an Existing Virtual Directory > NTFS Permissions (NTFS Permissions Tab)

SQL Server CE Books Online

NTFS Permissions: Computer Running IIS


After SQL Server CE Server Agent (Sscesa20.dll) is invoked, it attempts to create, read, write, and delete input and output replication or remote data
access (RDA) message files. These message files are placed on the computer running Microsoft Internet Information Services (IIS) in the content folder
that you specified when you configured the IIS virtual directory. This is the same folder that contains SQL Server CE Server Agent (Sscesa20.dll). You
control access to the folder and the SQL Server CE Server Agent by assigning NTFS permissions to that directory and file.

Read and Write access permissions are required on the content folder (also known as the temporary file location for the input and output message files),
and Read & Execute access permission is required on the SQL Server CE Server Agent (Sscesa20.dll).

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...cess_permissions58_computer_runni_705.asp?frame=true [22/07/2004 04:56:23 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Modifying an Existing Virtual Directory > NTFS Permissions (NTFS Permissions Tab)

SQL Server CE Books Online

NTFS Permissions: Computer


Running IIS
Up One Level
After SQL Server CE Server Agent (Sscesa20.dll) is invoked, it attempts to create, read,
NTFS Permissions: Computer Running IIS write, and delete input and output replication or remote data access (RDA) message files.
These message files are placed on the computer running Microsoft Internet Information
NTFS Permissions: Snapshot Folder Access Services (IIS) in the content folder that you specified when you configured the IIS virtual
directory. This is the same folder that contains SQL Server CE Server Agent (Sscesa20.dll).
You control access to the folder and the SQL Server CE Server Agent by assigning NTFS
permissions to that directory and file.

Read and Write access permissions are required on the content folder (also known as the
temporary file location for the input and output message files), and Read & Execute access
permission is required on the SQL Server CE Server Agent (Sscesa20.dll).

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li..._lce_ntfs_access_permissions58_computer_runni_705.asp [22/07/2004 04:56:26 p.m.]


NTFS Permissions: Snapshot Folder Access (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools > Modifying
an Existing Virtual Directory > NTFS Permissions (NTFS Permissions Tab)

SQL Server CE Books Online

NTFS Permissions: Snapshot Folder Access


Depending on the Virtual Directory Authentication that is selected, the appropriate Microsoft® Windows® user account requires Read permission on the
snapshot share specified and the underlying snapshot folder. For more information, see NTFS Permissions: User

For more information about snapshot folders, see Configuring the Snapshot Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...cess_permissions58_snapshot_folde_579.asp?frame=true [22/07/2004 04:56:35 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools > Modifying an Existing Virtual Directory > NTFS Permissions (NTFS Permissions Tab)

SQL Server CE Books Online

NTFS Permissions: Snapshot


Folder Access
Up One Level
Depending on the Virtual Directory Authentication that is selected, the appropriate
NTFS Permissions: Computer Running IIS Microsoft® Windows® user account requires Read permission on the snapshot share
specified and the underlying snapshot folder. For more information, see NTFS Permissions:
NTFS Permissions: Snapshot Folder Access User

For more information about snapshot folders, see Configuring the Snapshot Folder.

See Also

Virtual Directory Recommendations and Default Settings

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li..._lce_ntfs_access_permissions58_snapshot_folde_579.asp [22/07/2004 04:56:38 p.m.]


Virtual Directory Recommendations and Default Settings (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity Tools

SQL Server CE Books Online

Virtual Directory Recommendations and Default


Settings
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) relies on Microsoft Internet Information Services (IIS) virtual directories to access
data from a database in Microsoft SQL Server.

Virtual Directory Recommendations

It is recommended that you create a virtual directory for each application that requires data access, whether you are implementing replication or remote
data access (RDA). Using the SQL Server CE Virtual Directory Creation Wizard, you can create individual virtual directories for each Windows CE-based
application.

● IIS authentication and authorization is controlled at the virtual directory level. By creating a virtual directory for each SQL Server CE publication or for different groups of RDA clients, you can establish the
exact authentication and authorization policy you require for each publication or each set of clients.
● The SQL Server CE Server Agent allocates a separate worker-thread pool for each IIS virtual directory. These worker threads are used when database synchronization or RDA operations are performed. By
configuring an IIS virtual directory for each publication or different groups of RDA clients, you increase the number of worker threads and, therefore, the number of replication operations or clients that can
be active concurrently.

It is also recommended that you create one NTFS or FAT content folder for each IIS virtual directory. This content folder contains the SQL Server CE
Server Agent (Sscesa20.dll) and the temporary input and output message files that SQL Server CE creates during synchronization and RDA operations.

Important It is strongly recommended that you use NTFS, rather than FAT, because NTFS provides much stronger security. When
you use NTFS, you can use NTFS file permissions to control precisely the clients that can access SQL Server CE replication or RDA.

Virtual Directory Default Settings Using Connectivity Tools

The SQL Server CE Virtual Directory Creation Wizard configures a number of default settings to ensure minimum SQL Server CE requirements. In addition,
to the default settings described in the configuration topics, the following are also set on the virtual directory:

● The application protection mode is set to Medium (Pooled).


● Script Source Access option is not supported and, therefore, is not enabled.

If you want to change any of the default settings set by the wizard, see Modifying an Existing Virtual Directory. If you require more advanced configuration
options, see Advanced Security Configurations and the IIS documentation.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l..._directory_recommendations_and_de_705.asp?frame=true [22/07/2004 04:56:47 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Using Connectivity
Advanced Search Tools

SQL Server CE Books Online

Virtual Directory
Recommendations and Default
Up One Level Settings
Creating a New Virtual Directory
Modifying an Existing Virtual Directory Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) relies on Microsoft
Internet Information Services (IIS) virtual directories to access data from a database in
Virtual Directory Recommendations and Default Settings Microsoft SQL Server.

Virtual Directory Recommendations

It is recommended that you create a virtual directory for each application that requires data
access, whether you are implementing replication or remote data access (RDA). Using the
SQL Server CE Virtual Directory Creation Wizard, you can create individual virtual
directories for each Windows CE-based application.

● IIS authentication and authorization is controlled at the virtual directory level. By creating a virtual directory for
each SQL Server CE publication or for different groups of RDA clients, you can establish the exact authentication
and authorization policy you require for each publication or each set of clients.
● The SQL Server CE Server Agent allocates a separate worker-thread pool for each IIS virtual directory. These
worker threads are used when database synchronization or RDA operations are performed. By configuring an IIS
virtual directory for each publication or different groups of RDA clients, you increase the number of worker threads
and, therefore, the number of replication operations or clients that can be active concurrently.

It is also recommended that you create one NTFS or FAT content folder for each IIS virtual
directory. This content folder contains the SQL Server CE Server Agent (Sscesa20.dll) and
the temporary input and output message files that SQL Server CE creates during
synchronization and RDA operations.

Important It is strongly recommended that you use NTFS, rather


than FAT, because NTFS provides much stronger security. When you
use NTFS, you can use NTFS file permissions to control precisely the
clients that can access SQL Server CE replication or RDA.

Virtual Directory Default Settings Using Connectivity


Tools

The SQL Server CE Virtual Directory Creation Wizard configures a number of default settings
to ensure minimum SQL Server CE requirements. In addition, to the default settings
described in the configuration topics, the following are also set on the virtual directory:

● The application protection mode is set to Medium (Pooled).


● Script Source Access option is not supported and, therefore, is not enabled.

If you want to change any of the default settings set by the wizard, see Modifying an
Existing Virtual Directory. If you require more advanced configuration options, see
Advanced Security Configurations and the IIS documentation.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li..._lce_virtual_directory_recommendations_and_de_705.asp [22/07/2004 04:56:50 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS
Advanced Search

SQL Server CE Books Online


Advanced Security Configurations

The following topics provide information about manually configuring connectivity support
and additional security configuration options that are not configured using the SQL Server
CE Connectivity Management utility or the SQL Server CE Virtual Directory Creation Wizard.
These options are not required by Microsoft® SQL Server™ 2000 Windows® CE Edition
Up One Level (SQL Server CE) but may be required for your specific work environment.

Configuring IIS and NTFS Permissions Manually


Configuring IIS and NTFS Permissions Manually
Configuring SSL Encryption

● Configuring SSL Encryption


Configuring IP Address and Domain Name Restrictions
Configuring IP Address and Domain Name Restrictions

● Configuring IIS Security Auditing

Configuring IIS Security Auditing

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib...qlce/htm/_lce_advanced_security_configurations_579.asp [22/07/2004 04:57:22 p.m.]


Configuring IIS and NTFS Permissions Manually (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security Configurations

SQL Server CE Books Online

Configuring IIS and NTFS Permissions Manually


The connectivity support and security options for Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) that are set by using the SQL Server CE Virtual
Directory Creation Wizard can be configured manually. The following is a brief summary of the minimum configuration sets that are required to use replication or remote data
access (RDA).

Configuring Microsoft® Internet Information Services (IIS) for either replication or RDA involves the following steps:

1. Create a virtual directory using IIS:


a. Specify an alias name for the virtual directory.
b. Specify the location for the content folder for the virtual directory. A copy of the SQL Server CE Server Agent (Sscesa20.dll) must reside in this directory. By default, the SQL Server CE Server Agent is installed in C:\Program Files\Microsoft SQL Server CE 2.0\Server.

Note The name of the computer running IIS, the virtual directory, and the SQL Server CE Server Agent (Sscesa20.dll) must be specified as part of the InternetURL property for
connectivity. For example, the following URL accesses SQL Server CE Server Agent for replication or RDA: http://www.northwindtraders.com/sqlce/sscesa20.dll.

2. Specify the Execute access permission for the virtual directory.

For more information, see Virtual Directory Alias and Content Folder.

● Configure IIS authentication using IIS. Edit the properties of the virtual directory created in Step 1. SQL Server CE supports provides three authentication options:

● Anonymous access
● Basic authentication
● Integrated Windows authentication

For more information, see Virtual Directory Authentication.

● Configure IIS authorization using Windows Explorer.

Note If the computer running IIS has a FAT file system, you can skip this step. SQL Server CE replication or RDA works with a FAT file system, but it is
not secure. It is recommended that you use NTFS.

a. Configure directory authorization by navigating to the content folder you specified when you configured the IIS virtual directory, and then add the following NTFS permission on the folder.

User Required permissions


For Anonymous access, grant rights to the computername\IUSR_computername or the configured IIS anonymous user account. Read and Write

For Basic or Integrated Windows authentication, grant rights to the user or group of the client. Read and Write

b. Configure SQL Server CE Server Agent authorization by navigating to the content folder you specified when you configured the IIS virtual directory, and then add the following NTFS permission on Sscesa20.dll.

User Required permissions


For Anonymous access, grant rights to the computername\IUSR_computername or the configured IIS anonymous user account Read & Execute

For Basic or Integrated Windows authentication, grant rights to the user or group of the client Read & Execute

c. Configure the SQL Server snapshot folder if you are using replication. For more information, see Configuring the Snapshot Folder.

See Also

Planning for Security

Using Connectivity Tools

Configuring the Snapshot Folder

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...uring_iis_and_ntfs_access_permissi_289.asp?frame=true [22/07/2004 04:57:26 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security Configurations
MSDN Library Go
Advanced Search SQL Server CE Books Online

Configuring IIS and NTFS Permissions Manually


The connectivity support and security options for Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) that are set by using the SQL Server CE Virtual
Directory Creation Wizard can be configured manually. The following is a brief summary of the minimum configuration sets that are required to use replication or remote data
access (RDA).

Up One Level Configuring Microsoft® Internet Information Services (IIS) for either replication or RDA involves the following steps:

Configuring IIS and NTFS Permissions Manually


Configuring SSL Encryption 1. Create a virtual directory using IIS:
a. Specify an alias name for the virtual directory.
b. Specify the location for the content folder for the virtual directory. A copy of the SQL Server CE Server Agent (Sscesa20.dll) must reside in this directory. By default, the SQL Server CE Server Agent is installed in C:\Program Files\Microsoft SQL Server CE 2.0\Server.

Configuring IP Address and Domain Name Restrictions


Configuring IIS Security Auditing Note The name of the computer running IIS, the virtual directory, and the SQL Server CE Server Agent (Sscesa20.dll) must be specified as part of the InternetURL property for
connectivity. For example, the following URL accesses SQL Server CE Server Agent for replication or RDA: http://www.northwindtraders.com/sqlce/sscesa20.dll.

2. Specify the Execute access permission for the virtual directory.

For more information, see Virtual Directory Alias and Content Folder.

● Configure IIS authentication using IIS. Edit the properties of the virtual directory created in Step 1. SQL Server CE supports provides three authentication options:

● Anonymous access
● Basic authentication
● Integrated Windows authentication

For more information, see Virtual Directory Authentication.

● Configure IIS authorization using Windows Explorer.

Note If the computer running IIS has a FAT file system, you can skip this step. SQL Server CE replication or RDA works with a FAT file system, but it is
not secure. It is recommended that you use NTFS.

a. Configure directory authorization by navigating to the content folder you specified when you configured the IIS virtual directory, and then add the following NTFS permission on the folder.

User Required permissions


For Anonymous access, grant rights to the computername\IUSR_computername or the configured IIS anonymous user account. Read and Write

For Basic or Integrated Windows authentication, grant rights to the user or group of the client. Read and Write

b. Configure SQL Server CE Server Agent authorization by navigating to the content folder you specified when you configured the IIS virtual directory, and then add the following NTFS permission on Sscesa20.dll.

User Required permissions


For Anonymous access, grant rights to the computername\IUSR_computername or the configured IIS anonymous user account Read & Execute

For Basic or Integrated Windows authentication, grant rights to the user or group of the client Read & Execute

c. Configure the SQL Server snapshot folder if you are using replication. For more information, see Configuring the Snapshot Folder.

See Also

Planning for Security

Using Connectivity Tools

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_configuring_iis_and_ntfs_access_permissi_289.asp (1 of 2) [22/07/2004 04:57:29 p.m.]


Welcome to the MSDN Library
Configuring the Snapshot Folder

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_configuring_iis_and_ntfs_access_permissi_289.asp (2 of 2) [22/07/2004 04:57:29 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity
Support in IIS > Advanced Security Configurations
Advanced Search

SQL Server CE Books Online

Configuring SSL Encryption


Secure Sockets Layer (SSL) is the most widely used method for transmitting
encrypted data over the Internet. SSL uses public key cryptography to securely
generate and exchange a secret key called the session key. The Microsoft®
Up One Level Windows® CE-based client and Microsoft Internet Information Services (IIS) use the
session key to encrypt and decrypt the data they send to one another.
Updating the Database of Trusted Certificate Authorities on a Windows CE-based Device
Replication and remote data access (RDA) do not require encryption; however, there
are circumstances when you should use it. For more information, see Planning for
Security.

Windows CE maintains a database of trusted Certificate Authorities (CA). When a


secure connection is attempted, Windows CE extracts the root certificate from the
certification chain and checks it against the Certificate Authority database. If you
issue an IIS server certificate using your own stand-alone CA, this root certificate is
not present in the Windows CE Certificate Authority database. As a result, Windows
CE does not trust this IIS server certificate. If you want to use server certificates
that you issue yourself, you must either certify your stand-alone CA through one of
the trusted certificate authorities or add your stand-alone CA root certificate to the
Windows CE Certificate Authority database.

The SSL features in IIS cannot be used until you obtain and assign a server
certificate to the computer running IIS.

SSL Configuration Process

Configuring SSL encryption is a multistep process that involves:

1. Requesting a server certificate for the computer running IIS. If the IIS server already has a server
certificate, you can skip to Step 4.
2. Obtaining a server certificate from a certificate authority. For more information about obtaining server
certificates, see Windows online Help.
3. Installing the newly issued server certificate into IIS.
4. Enabling SSL encryption.
5. Updating the database of trusted Certificate Authority on each of the Windows CE-based devices so they
recognize the server certificate as authentic.

For more information about the trusted Certificate Authorities maintained by


Windows CE, see the Microsoft Knowledge Base article "List and Add Schannel Root
Certificates (Q290288)" at this Microsoft Web site.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_configuring_ssl_encryption_705.asp (1 of 2) [22/07/2004 04:57:36 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_configuring_ssl_encryption_705.asp (2 of 2) [22/07/2004 04:57:36 p.m.]


Updating the Database of Trusted Certificate Authorities on a Windows CE-based Device (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security Configurations >
Configuring SSL Encryption

SQL Server CE Books Online

Updating the Database of Trusted Certificate


Authorities on a Windows CE-based Device
After saving the root certificate of the stand-alone certificate authority to the *.cer file, you must install the root certificate in the Windows CE Certificate
Authority database on the Microsoft® Windows® CE-based device.

To install the root certificate on the Windows CE-based device

1. From the SQL Server CE installation directory (by default: Program Files\Microsoft SQL Server CE 2.0\Device\processor family\processor type), copy the root certificate utility program (Rootcert.exe) that
matches the processor type of the Window CE-based device to the \Windows directory on the device.
2. Copy your root certificate to the root directory of the Windows CE-based device.
3. From File Explorer, run Rootcert.exe.

Rootcert.exe does the following:

1. Opens and reads the root certificate file contained in the root directory of the Windows CE-based device.
2. Creates the registry key HKLM\Comm\SecurityProviders\SCHANNEL\CAs if this key does not already exist in the registry on the Windows CE-based device.
3. Creates the registry key HKLM\Comm\SecurityProviders\SCHANNEL\CAs\filename, where filename is the name of the root certificate file.
4. Creates the following registry values under the HKLM\Comm\SecurityProviders\SCHANNEL\CAs\filename key:
● DWORD:Enabled = 1
● DWORD:Type = 1
● BINARY:CACert = X509 certificate bytes obtained from the .CER file.
5. Displays the message: "Root certificate installed successfully."

After you update the Windows CE registry, start the application that is using SQL Server CE replication or remote data access (RDA). Windows CE uses the
root certificate the next time Secure Sockets Layer (SSL) is invoked.

If you want to use server certificates that you issue yourself, the following limitations apply when requesting a server certificate:

● Naming limitations

This limitation exists because Windows CE 3.0 cannot accept server certificates containing Unicode character strings. For more information, see the Microsoft Knowledge Base article "How Special
Characters in the Name Field Effect Certificates (Q216947)" at this Microsoft Web site.

● Windows CE-based devices running Windows CE 3.0 do not recognize IIS server certificates signed by using either the MD4 or RSA/SHA1 signature algorithms.

Windows CE-based devices reject such certificates with the error: "ERROR_INTERNET_SECURITY_CHANNEL_ERROR". To be acceptable to a Windows CE-based device, an IIS server certificate must be
signed using either the MD2 or MD5 signature algorithm.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/__l..._certificate_authorities_on_windows_ce.asp?frame=true [22/07/2004 04:57:41 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity
Support in IIS > Advanced Security Configurations > Configuring SSL Encryption
Advanced Search

SQL Server CE Books Online

Updating the Database of


Trusted Certificate
Authorities on a Windows CE-
Up One Level
Updating the Database of Trusted Certificate Authorities on a Windows CE-based Device
based Device
After saving the root certificate of the stand-alone certificate authority to the *.cer
file, you must install the root certificate in the Windows CE Certificate Authority
database on the Microsoft® Windows® CE-based device.

To install the root certificate on the Windows CE-based device

1. From the SQL Server CE installation directory (by default: Program Files\Microsoft SQL Server CE
2.0\Device\processor family\processor type), copy the root certificate utility program (Rootcert.exe) that
matches the processor type of the Window CE-based device to the \Windows directory on the device.
2. Copy your root certificate to the root directory of the Windows CE-based device.
3. From File Explorer, run Rootcert.exe.

Rootcert.exe does the following:

1. Opens and reads the root certificate file contained in the root directory of the Windows CE-based device.
2. Creates the registry key HKLM\Comm\SecurityProviders\SCHANNEL\CAs if this key does not
already exist in the registry on the Windows CE-based device.
3. Creates the registry key HKLM\Comm\SecurityProviders\SCHANNEL\CAs\filename, where
filename is the name of the root certificate file.
4. Creates the following registry values under the
HKLM\Comm\SecurityProviders\SCHANNEL\CAs\filename key:
● DWORD:Enabled = 1
● DWORD:Type = 1
● BINARY:CACert = X509 certificate bytes obtained from the .CER file.
5. Displays the message: "Root certificate installed successfully."

After you update the Windows CE registry, start the application that is using SQL
Server CE replication or remote data access (RDA). Windows CE uses the root
certificate the next time Secure Sockets Layer (SSL) is invoked.

If you want to use server certificates that you issue yourself, the following limitations
apply when requesting a server certificate:

● Naming limitations

This limitation exists because Windows CE 3.0 cannot accept server certificates containing Unicode
character strings. For more information, see the Microsoft Knowledge Base article "How Special
Characters in the Name Field Effect Certificates (Q216947)" at this Microsoft Web site.

● Windows CE-based devices running Windows CE 3.0 do not recognize IIS server certificates signed by
using either the MD4 or RSA/SHA1 signature algorithms.

Windows CE-based devices reject such certificates with the error:


"ERROR_INTERNET_SECURITY_CHANNEL_ERROR". To be acceptable to a Windows CE-based device, an
IIS server certificate must be signed using either the MD2 or MD5 signature algorithm.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/ht...pdating_the_database_of_trusted_certificate_authorities_on_windows_ce.asp (1 of 2) [22/07/2004 04:57:44 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/ht...pdating_the_database_of_trusted_certificate_authorities_on_windows_ce.asp (2 of 2) [22/07/2004 04:57:44 p.m.]


Configuring IP Address and Domain Name Restrictions (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security Configurations

SQL Server CE Books Online

Configuring IP Address and Domain Name


Restrictions
You can use Microsoft® Internet Information Services (IIS) IP address and domain name restrictions to grant or deny specific computers, groups of
computers, or domains access to the IIS Web site. For example, if your intranet server is connected to the Internet, you can prevent Internet users from
accessing your IIS Web server by granting access only to members of your intranet and explicitly denying access to outside users. For more information,
see the IIS documentation.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l..._address_and_domain_name_restrictions.asp?frame=true [22/07/2004 04:58:23 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security
Advanced Search Configurations

SQL Server CE Books Online

Configuring IP Address and


Domain Name Restrictions
Up One Level
You can use Microsoft® Internet Information Services (IIS) IP address and domain name
Configuring IIS and NTFS Permissions Manually restrictions to grant or deny specific computers, groups of computers, or domains access to
the IIS Web site. For example, if your intranet server is connected to the Internet, you can
Configuring SSL Encryption prevent Internet users from accessing your IIS Web server by granting access only to
members of your intranet and explicitly denying access to outside users. For more
Configuring IP Address and Domain Name Restrictions information, see the IIS documentation.

Configuring IIS Security Auditing

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li...nfiguring_ip_address_and_domain_name_restrictions.asp [22/07/2004 04:58:26 p.m.]


Configuring IIS Security Auditing (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security Configurations

SQL Server CE Books Online

Configuring IIS Security Auditing


You can monitor the security of replication and remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) by
using the security auditing mechanisms built into Microsoft Windows and Microsoft Internet Information Services (IIS). Auditing consists of creating
auditing polices regarding access to your IIS Web server and NTFS directories and files, and monitoring the security logs to detect any access attempts by
unauthorized persons. For more information, see the IIS documentation.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/__lceconfiguring_iis_security_auditing.asp?frame=true [22/07/2004 04:58:34 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Configuring Connectivity Support in IIS > Advanced Security
Advanced Search Configurations

SQL Server CE Books Online

Configuring IIS Security


Auditing
Up One Level
You can monitor the security of replication and remote data access (RDA) in Microsoft® SQL
Configuring IIS and NTFS Permissions Manually Server™ 2000 Windows® CE Edition (SQL Server CE) by using the security auditing
mechanisms built into Microsoft Windows and Microsoft Internet Information Services (IIS).
Configuring SSL Encryption Auditing consists of creating auditing polices regarding access to your IIS Web server and
NTFS directories and files, and monitoring the security logs to detect any access attempts
Configuring IP Address and Domain Name Restrictions by unauthorized persons. For more information, see the IIS documentation.

Configuring IIS Security Auditing

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libra...-us/sqlce/htm/__lceconfiguring_iis_security_auditing.asp [22/07/2004 04:58:37 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity
Advanced Search

SQL Server CE Books Online


Using SQL Server CE Relay

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) extends enterprise
data to the Windows CE-based mobile device. By using merge replication or remote data
access (RDA), you can share data with users in the field even when there is no integrated
network capability or when a network card cannot be used. SQL Server CE Relay allows
Up One Level communication to operate bidirectionally between a mobile device and the server by using
the network connection on a desktop computer.
How SQL Server CE Relay Works
Planning for SQL Server CE Relay Important SQL Server CE Relay is not required for Microsoft
Windows Powered Pocket PC 2002-based devices that are connected
Installing and Configuring SQL Server CE Relay to desktop computers running Microsoft ActiveSync® 3.5. The
ActiveSync 3.5 connection setting Allow network (Ethernet) and
Running SQL Server CE Relay Remote Access Service (RAS) server connections with this
desktop computer is set by default and supports Secure Sockets
Layer (SSL) encryption and Integrated Windows authentication
connections.

The benefits of using SQL Server CE Relay include:

● Lower computing costs.

If the Windows CE-based devices contain modem cards, you might have to pay for their dial-in connections to their
servers. Being able to synchronize data in SQL Server CE while the Windows CE-based device is cradled and
connected to the server can save on overall computing costs.

● Connection capability in unfavorable wireless situations.

If wireless coverage in an office is limited because of concrete walls in the building or some other interference, you
can use any configured desktop to synchronize database data with SQL Server.

● Connection capability when wireless network cards are not permitted because of radio transmission restrictions.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_server_ce_relay.asp [22/07/2004 04:59:08 p.m.]


How SQL Server CE Relay Works (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay

SQL Server CE Books Online


How SQL Server CE Relay Works

SQL Server CE Relay allows the USB, serial, or infrared (IR) connections through desktop computers to serve as a conduit for synchronization to an
instance of Microsoft® SQL Server™ by using Microsoft Internet Information Services (IIS). The following illustration shows how a Pocket PC 2000-based
device connects to a server computer through a Microsoft ActiveSync® desktop connection.

When the client code on the Microsoft Windows® CE-based device sets the InternetProxyServer property of the SQL Server CE ActiveX® control to
ppp_peer:nn (where nn is a specified listening client port number on a desktop computer), ActiveSync recognizes the ppp_peer command, and the
requests sent to the desktop computer appear on this designated client port. Relay is listening on the same client port; it accepts the request from the
mobile device and sends the request to a port on a preconfigured server (either an IIS server or a proxy server). This process works identically but in
reverse when the responding synchronization data comes back from the computer that is running SQL Server.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_how_sql_server_ce_relay_works_705.asp?frame=true [22/07/2004 04:59:12 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000
MSDN Library Go Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server
CE Relay
Advanced Search

SQL Server CE Books Online


How SQL Server CE Relay Works

SQL Server CE Relay allows the USB, serial, or infrared (IR) connections through desktop computers to serve as a conduit
for synchronization to an instance of Microsoft® SQL Server™ by using Microsoft Internet Information Services (IIS). The
following illustration shows how a Pocket PC 2000-based device connects to a server computer through a Microsoft
ActiveSync® desktop connection.
Up One Level
How SQL Server CE Relay Works
Planning for SQL Server CE Relay
Installing and Configuring SQL Server CE Relay
Running SQL Server CE Relay

When the client code on the Microsoft Windows® CE-based device sets the InternetProxyServer property of the SQL
Server CE ActiveX® control to ppp_peer:nn (where nn is a specified listening client port number on a desktop computer),
ActiveSync recognizes the ppp_peer command, and the requests sent to the desktop computer appear on this designated
client port. Relay is listening on the same client port; it accepts the request from the mobile device and sends the request to
a port on a preconfigured server (either an IIS server or a proxy server). This process works identically but in reverse when
the responding synchronization data comes back from the computer that is running SQL Server.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li.../sqlce/htm/_lce_how_sql_server_ce_relay_works_705.asp [22/07/2004 04:59:15 p.m.]


Planning for SQL Server CE Relay (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay

SQL Server CE Books Online


Planning for SQL Server CE Relay

When you are planning to implement SQL Server CE Relay, consider the following background information:

● Relay works on desktop computers that are running Microsoft® Windows® 98 SE, Microsoft Windows ME, Microsoft Windows NT® 4.0 with Service Pack 6 or later, Microsoft Windows 2000, and Microsoft
Windows XP.
● Relay uses the peer point-to-point protocol (ppp_peer), a tunneling protocol that encapsulates Point-to-Point Protocol frames into IP datagrams for transmission over an IP-based network, in Microsoft
operating systems. This means that the desktop computer functions as a proxy that can connect the mobile device to any server to which the desktop computer is connected. SQL Server CE Relay is not a
true proxy server because it cannot encrypt data, but you still have firewall support if firewall support exists at the desktop computer.
● SQL Server CE Relay requires Microsoft ActiveSync® 3.1 or later installed on the desktop computer. ActiveSync enables the ability to use the serial, infrared (IR), or USB connection (that is, the ppp_peer
command can be interpreted as part of the serial, IR, or USB connection) between the mobile device that is running Microsoft SQL Server™ 2000 Windows CE Edition (SQL Server CE) and the desktop
computer. The partnership can be a guest connection.
● Relay does not support Secure Sockets Layer (SSL) encryption or Integrated Windows authentication. If you require SSL encryption, you must upgrade to Pocket PC 2002 and ActiveSync 3.5.

Before you install SQL Server CE Relay on the desktop computer, be sure that the following are installed or configured on this computer:

● SQL Server CE Server Tools is installed.


● The SQL Server CE Server Agent is configured correctly on the computer running IIS.
● SQL Server is configured correctly for either remote data access (RDA) or merge replication connectivity.

Note It is assumed that you are familiar with at least one of the two types of connectivity that is supported by SQL
Server CE (merge replication or remote data access).

● Security is set up correctly for connectivity to SQL Server.

Note For more information about configuring IIS and SQL Server for connectivity, see Planning for Security.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_implementing_sql_server_ce_relay_533.asp?frame=true [22/07/2004 04:59:20 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay
Advanced Search

SQL Server CE Books Online


Planning for SQL Server CE Relay

When you are planning to implement SQL Server CE Relay, consider the following
background information:

Up One Level ● Relay works on desktop computers that are running Microsoft® Windows® 98 SE, Microsoft Windows ME, Microsoft
Windows NT® 4.0 with Service Pack 6 or later, Microsoft Windows 2000, and Microsoft Windows XP.

How SQL Server CE Relay Works ● Relay uses the peer point-to-point protocol (ppp_peer), a tunneling protocol that encapsulates Point-to-Point
Protocol frames into IP datagrams for transmission over an IP-based network, in Microsoft operating systems. This
means that the desktop computer functions as a proxy that can connect the mobile device to any server to which
Planning for SQL Server CE Relay the desktop computer is connected. SQL Server CE Relay is not a true proxy server because it cannot encrypt data,
but you still have firewall support if firewall support exists at the desktop computer.
SQL Server CE Relay requires Microsoft ActiveSync® 3.1 or later installed on the desktop computer. ActiveSync
Installing and Configuring SQL Server CE Relay

enables the ability to use the serial, infrared (IR), or USB connection (that is, the ppp_peer command can be
interpreted as part of the serial, IR, or USB connection) between the mobile device that is running Microsoft SQL
Server™ 2000 Windows CE Edition (SQL Server CE) and the desktop computer. The partnership can be a guest
Running SQL Server CE Relay ●
connection.
Relay does not support Secure Sockets Layer (SSL) encryption or Integrated Windows authentication. If you
require SSL encryption, you must upgrade to Pocket PC 2002 and ActiveSync 3.5.

Before you install SQL Server CE Relay on the desktop computer, be sure that the following
are installed or configured on this computer:

● SQL Server CE Server Tools is installed.


● The SQL Server CE Server Agent is configured correctly on the computer running IIS.
● SQL Server is configured correctly for either remote data access (RDA) or merge replication connectivity.

Note It is assumed that you are familiar with at least


one of the two types of connectivity that is supported by
SQL Server CE (merge replication or remote data
access).

● Security is set up correctly for connectivity to SQL Server.

Note For more information about configuring IIS and


SQL Server for connectivity, see Planning for Security.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib...qlce/htm/_lce_implementing_sql_server_ce_relay_533.asp [22/07/2004 04:59:23 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay
Advanced Search

SQL Server CE Books Online


Installing and Configuring SQL Server CE Relay

For information about installing SQL Server CE Relay, see Using SQL Server CE Relay with
an ActiveSync System. The following topics in this section describe the configuration options
and requirements:

Up One Level
Configuring the Desktop Computer to Use SQL Server CE Relay ●


Configuring the Desktop Computer to Use SQL Server CE Relay
Configuring the Mobile Device to Use SQL Server CE Relay

Configuring the Mobile Device to Use SQL Server CE Relay ● SQL Server CE Relay Configuration Options

SQL Server CE Relay Configuration Options

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...m/_lce_installing_and_configuring_sql_server_re_579.asp [22/07/2004 04:59:29 p.m.]


Configuring the Desktop Computer to Use SQL Server CE Relay (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Installing and Configuring SQL Server CE Relay

SQL Server CE Books Online

Configuring the Desktop Computer to Use SQL


Server CE Relay
To configure the desktop computer to use SQL Server CE Relay, you must specify the following:

● Client port number


● Name of the destination server
● Server port number

The client port and server port configurations are very important for Relay to function correctly.

Client Port Number

The client port number is the port on which the desktop computer listens for requests from the Microsoft® Windows® CE-based device. Specify this port
number as the value for the /clientport option.

Name of Destination Server

The server name is the key to identifying where you want information from the desktop to be relayed. If you are using a proxy server, the value of
/servername is the name of the proxy server computer. If you are not using a proxy server, the value of /servername is the name of the computer
running Microsoft Internet Information Services (IIS) that you are using to synchronize with Microsoft SQL Server™ 2000 Windows CE Edition (SQL Server
CE). The name of the computer running IIS must be the same as the name that is specified in the InternetURL property on the mobile device.

It is possible to specify one server name in SQL Server CE Relay and a different server name through the SQL Server CE ActiveX® control, although this is
not a recommended procedure. For the synchronization to succeed, the virtual directory names and security access must be the same on both servers. If
both servers are valid IIS servers, Relay sends the data to the server that is specified in its parameters. Synchronization can fail if the virtual directory or
a server agent does not exist, or if either is not correctly configured. The synchronization succeeds if both servers are set up identically and each has
access to the computer running SQL Server.

Server Port Number

Specify the port number for the server that is identified by the /servername option. This is the port number for the computer on which the Internet
application is configured. For example, if a virtual directory for SQL Server CE Server Agent has been created in the Default Web Site in IIS, the default
server port is 80. Specify the server port number as the value for the /serverport option.

The following list shows services and their associated ports:

● HTTP over TCP/IP

Web servers, such as IIS: port 80

● HTTPS over TCP/IP

HTTP over SSL for encrypting Web traffic: port 443

● FTP over TCP/IP: FTP

Port 21, port 20, and ports 1024-65535

● SMTP over TCP/IP

Simple Mail Transfer Protocol (SMTP), which is used by applications such as Microsoft Exchange Server: port 25.

http://msdn.microsoft.com/library/en-us/sqlce/ht...g_the_desktop_computer_to_use__45.asp?frame=true (1 of 2) [22/07/2004 04:59:34 p.m.]


Configuring the Desktop Computer to Use SQL Server CE Relay (SQL Server CE Books Online)

Most other ports are available; check the services running on your system before you assign port numbers.

See Also

SQL Server CE Relay Configuration Options

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/ht...g_the_desktop_computer_to_use__45.asp?frame=true (2 of 2) [22/07/2004 04:59:34 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay > Installing and Configuring SQL
Advanced Search Server CE Relay

SQL Server CE Books Online

Configuring the Desktop


Computer to Use SQL Server CE
Up One Level Relay
Configuring the Desktop Computer to Use SQL Server CE Relay
Configuring the Mobile Device to Use SQL Server CE Relay To configure the desktop computer to use SQL Server CE Relay, you must specify the
following:
SQL Server CE Relay Configuration Options
● Client port number
● Name of the destination server
● Server port number

The client port and server port configurations are very important for Relay to function
correctly.

Client Port Number

The client port number is the port on which the desktop computer listens for requests from
the Microsoft® Windows® CE-based device. Specify this port number as the value for the
/clientport option.

Name of Destination Server

The server name is the key to identifying where you want information from the desktop to
be relayed. If you are using a proxy server, the value of /servername is the name of the
proxy server computer. If you are not using a proxy server, the value of /servername is
the name of the computer running Microsoft Internet Information Services (IIS) that you
are using to synchronize with Microsoft SQL Server™ 2000 Windows CE Edition (SQL Server
CE). The name of the computer running IIS must be the same as the name that is specified
in the InternetURL property on the mobile device.

It is possible to specify one server name in SQL Server CE Relay and a different server
name through the SQL Server CE ActiveX® control, although this is not a recommended
procedure. For the synchronization to succeed, the virtual directory names and security
access must be the same on both servers. If both servers are valid IIS servers, Relay sends
the data to the server that is specified in its parameters. Synchronization can fail if the
virtual directory or a server agent does not exist, or if either is not correctly configured. The
synchronization succeeds if both servers are set up identically and each has access to the
computer running SQL Server.

Server Port Number

Specify the port number for the server that is identified by the /servername option. This is
the port number for the computer on which the Internet application is configured. For
example, if a virtual directory for SQL Server CE Server Agent has been created in the
Default Web Site in IIS, the default server port is 80. Specify the server port number as the
value for the /serverport option.

The following list shows services and their associated ports:

● HTTP over TCP/IP

Web servers, such as IIS: port 80

● HTTPS over TCP/IP

HTTP over SSL for encrypting Web traffic: port 443

● FTP over TCP/IP: FTP

Port 21, port 20, and ports 1024-65535

● SMTP over TCP/IP

Simple Mail Transfer Protocol (SMTP), which is used by applications such as Microsoft Exchange Server: port 25.

Most other ports are available; check the services running on your system before you assign
port numbers.

http://msdn.microsoft.com/library/default.asp?url...e_configuring_the_desktop_computer_to_use__45.asp (1 of 2) [22/07/2004 04:59:38 p.m.]


Welcome to the MSDN Library

See Also

SQL Server CE Relay Configuration Options

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url...e_configuring_the_desktop_computer_to_use__45.asp (2 of 2) [22/07/2004 04:59:38 p.m.]


Configuring the Mobile Device to Use SQL Server CE Relay (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Installing and Configuring SQL Server CE Relay

SQL Server CE Books Online

Configuring the Mobile Device to Use SQL Server CE


Relay
To start the process of relaying the information from the Microsoft® Windows® CE-based device through the desktop to Microsoft Internet Information
Services (IIS) on the Internet or an intranet, you must set the InternetProxyServer property in the Microsoft ActiveX® control in the Microsoft SQL
Server™ 2000 Windows CE-based application. Set this property to ppp_peer:nn, where nn is the client port number on the desktop computer. This
number must be the same as the client port number that has been specified by /clientport on the desktop computer.

See Also

SQL Server CE Relay Configuration Options

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...uring_the_mobile_device_to_use_rel_414.asp?frame=true [22/07/2004 04:59:42 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay > Installing and Configuring SQL
Advanced Search Server CE Relay

SQL Server CE Books Online

Configuring the Mobile Device


to Use SQL Server CE Relay
Up One Level
To start the process of relaying the information from the Microsoft® Windows® CE-based
Configuring the Desktop Computer to Use SQL Server CE Relay device through the desktop to Microsoft Internet Information Services (IIS) on the Internet
or an intranet, you must set the InternetProxyServer property in the Microsoft ActiveX®
Configuring the Mobile Device to Use SQL Server CE Relay control in the Microsoft SQL Server™ 2000 Windows CE-based application. Set this property
to ppp_peer:nn, where nn is the client port number on the desktop computer. This number
SQL Server CE Relay Configuration Options must be the same as the client port number that has been specified by /clientport on the
desktop computer.

See Also

SQL Server CE Relay Configuration Options

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../_lce_configuring_the_mobile_device_to_use_rel_414.asp [22/07/2004 04:59:45 p.m.]


SQL Server CE Relay Configuration Options (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Installing and Configuring SQL Server CE Relay

SQL Server CE Books Online

SQL Server CE Relay Configuration Options


The following table lists and describes the options that determine how SQL Server CE Relay functions. These options and their associated values must be space
delimited; however, the options can be specified in any order.

Option Description
/clientport* The port on the desktop computer to and from which the client (the Microsoft® Windows® CE-based device) reads and writes.

/servername* The name of either the computer that is running Microsoft Internet Information Services (IIS) or the proxy server to which Relay connects through the desktop computer. Using a proxy server
allows the client more flexibility because the client can go to any server that the proxy server can reach.

If an IIS server is used, this value must be the same as the value that is specified in the InternetURL property in the Windows CE-based application.

The IP address of the respective server computer can also be used for specifying the server name. UNC paths are not accepted for specifying the server name, however.

For example, the following fails during synchronization:


/servername "\\myIISserver"

The following succeeds during synchronization:


/servername myIISserver

/serverport* The port to and from which the server reads and writes. This is usually port 80.

/register Registers Relay with Microsoft ActiveSync® connect and disconnect features.

/unregister Unregisters Relay with ActiveSync connect and disconnect features.

/noui Runs Relay without the icons appearing in the Windows taskbar.

/? Calls Help at the command prompt, which lists SQL Server CE Relay parameters.

/stop Halts all instances of Relay that are running, whether they were started manually or automatically.

*This option must be specified with a value to run Relay.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_configuration_options_862.asp?frame=true [22/07/2004 04:59:51 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Installing and Configuring SQL Server CE Relay
MSDN Library Go
Advanced Search SQL Server CE Books Online

SQL Server CE Relay Configuration Options


The following table lists and describes the options that determine how SQL Server CE Relay functions. These options and their associated values must be space
delimited; however, the options can be specified in any order.

Up One Level Option Description

Configuring the Desktop Computer to Use SQL Server CE Relay /clientport* The port on the desktop computer to and from which the client (the Microsoft® Windows® CE-based device) reads and writes.

/servername* The name of either the computer that is running Microsoft Internet Information Services (IIS) or the proxy server to which Relay connects through the desktop computer. Using a proxy server
Configuring the Mobile Device to Use SQL Server CE Relay allows the client more flexibility because the client can go to any server that the proxy server can reach.

SQL Server CE Relay Configuration Options If an IIS server is used, this value must be the same as the value that is specified in the InternetURL property in the Windows CE-based application.

The IP address of the respective server computer can also be used for specifying the server name. UNC paths are not accepted for specifying the server name, however.

For example, the following fails during synchronization:


/servername "\\myIISserver"

The following succeeds during synchronization:


/servername myIISserver

/serverport* The port to and from which the server reads and writes. This is usually port 80.

/register Registers Relay with Microsoft ActiveSync® connect and disconnect features.

/unregister Unregisters Relay with ActiveSync connect and disconnect features.

/noui Runs Relay without the icons appearing in the Windows taskbar.

/? Calls Help at the command prompt, which lists SQL Server CE Relay parameters.

/stop Halts all instances of Relay that are running, whether they were started manually or automatically.

*This option must be specified with a value to run Relay.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_configuration_options_862.asp [22/07/2004 04:59:54 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay
MSDN Library Go
Advanced Search SQL Server CE Books Online
Running SQL Server CE Relay

SQL Server CE Relay appears as an icon on the Microsoft® Windows® status bar whenever Relay is running. One icon appears for each instance of Relay. Different
icons appear according to the function Relay is performing.

Icon Description
Up One Level
Registering SQL Server CE Relay with ActiveSync to Run Automatically
Running a Single Instance of SQL Server CE Relay Manually Information is traveling from the device that is running Microsoft SQL Server™ 2000 Windows CE Edition (SQL Server CE) to the desktop computer.

Running Multiple Instances of SQL Server CE Relay Manually


Information is traveling from the desktop computer to the device that is running SQL Server CE.

Information is traveling both ways between the desktop computer and the device that is running SQL Server CE.

Although SQL Server CE Relay is running, no information is traveling between the desktop computer and the device that is running SQL Server CE.

SQL Server CE Relay can be run in either of the following configurations:

● Automatic
● Manual

In manual configuration, you can elect to run a single instance or multiple instances of Relay.

If SQL Server CE Relay is not configured correctly, an error is written to the errors text file (Sscerelay.log) on the desktop computer. This file is in the same folder
from which Sscerelay.exe is run.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_running_sql_server_ce_relay_289.asp [22/07/2004 05:00:07 p.m.]


Registering SQL Server CE Relay with ActiveSync to Run Automatically (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Running SQL Server CE Relay

SQL Server CE Books Online

Registering SQL Server CE Relay with ActiveSync to


Run Automatically
The preferred configuration for running SQL Server CE Relay is to register Relay with Microsoft® ActiveSync®. By registering Relay with ActiveSync, Relay
automatically starts and stops whenever the connection between the device running Microsoft SQL Server™ 2000 Windows® CE Edition (SQL Server CE)
and ActiveSync is active. The client application can then synchronize data as necessary.

To register Relay with ActiveSync, configure Relay with the /register option. You only have to do this once, as long as the configuration parameters for
the options /clientport, /servername, and /serverport do not change.

When you specify the /register option, two registry keys are created automatically within Windows CE Services:

● One registry key is created under HKEY_LOCALMACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect, with the string value name MicrosoftSSCERELAYAutoConnect.
This key is set with string value data that is based on the parameters you specified when you configured Relay.
● A second registry key is created under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnDisconnect, with the string value name
MicrosoftSSCERELAYAutoDisconnect. This key is set when you specify the /Stop option.

Important Only one instance of SQL Server CE Relay can be registered with ActiveSync. When a second instance is
registered, it replaces the first instance in the registry.

When an ActiveSync connection is made, it starts Relay with the parameters that were specified when Relay was configured.

Important When the ActiveSync connection is broken, all instances of Relay stop.

For example, if the name of the computer running Microsoft Internet Information Services (IIS) or the name of the proxy server is CorpServer, the
options to run Relay are entered at the command prompt as:

sscerelay /clientport 81 /servername CorpServer /serverport 80 /register

In the preceding example:

● The mobile device posts requests to and listens for responses on port 81 of the desktop computer.
● The desktop computer listens for requests from the client on port 81 and forwards them to port 80 of the server that is specified by the /servername option. The desktop computer then listens for
responses from the server on port 81 and posts them to the client on port 81.
● If the computer that is specified in the /servername option is an IIS server, its name must match the server name that is supplied in the InternetURL property of the Microsoft ActiveX® control on the
mobile device. SQL Server CE Server Tools must be installed on the computer and the SQL Server CE Server Agent configured on it. If the computer that is specified in the /servername option is a proxy
server, it does not require SQL Server CE Server Tools or the SQL Server CE Server Agent because it forwards requests to an appropriately configured computer running IIS (the one that is specified in the
InternetURL property on the mobile device).
● The /register option registers Relay to run every time an ActiveSync connection is made.

Note The InternetProxyServer property must be set to ppp_peer:81 in the SQL Server CE ActiveX control on the
Microsoft Windows CE-based device.

Use the /unregister option at the command prompt to unregister Relay from ActiveSync, as shown here:

sscerelay /unregister

This removes the registry keys from Windows CE Services.

http://msdn.microsoft.com/library/en-us/sqlce/htm...g_relay_with_activesync_to_run_774.asp?frame=true (1 of 2) [22/07/2004 05:00:12 p.m.]


Registering SQL Server CE Relay with ActiveSync to Run Automatically (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm...g_relay_with_activesync_to_run_774.asp?frame=true (2 of 2) [22/07/2004 05:00:12 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay > Running SQL Server CE Relay
Advanced Search

SQL Server CE Books Online

Registering SQL Server CE


Relay with ActiveSync to Run
Automatically
Up One Level
Registering SQL Server CE Relay with ActiveSync to Run Automatically The preferred configuration for running SQL Server CE Relay is to register Relay with
Microsoft® ActiveSync®. By registering Relay with ActiveSync, Relay automatically starts
Running a Single Instance of SQL Server CE Relay Manually and stops whenever the connection between the device running Microsoft SQL Server™
2000 Windows® CE Edition (SQL Server CE) and ActiveSync is active. The client application
Running Multiple Instances of SQL Server CE Relay Manually can then synchronize data as necessary.

To register Relay with ActiveSync, configure Relay with the /register option. You only have
to do this once, as long as the configuration parameters for the options /clientport,
/servername, and /serverport do not change.

When you specify the /register option, two registry keys are created automatically within
Windows CE Services:

● One registry key is created under HKEY_LOCALMACHINE\SOFTWARE\Microsoft\Windows CE


Services\AutoStartOnConnect, with the string value name MicrosoftSSCERELAYAutoConnect. This key is set
with string value data that is based on the parameters you specified when you configured Relay.
● A second registry key is created under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnDisconnect, with the string value name MicrosoftSSCERELAYAutoDisconnect. This key
is set when you specify the /Stop option.

Important Only one instance of SQL Server CE Relay


can be registered with ActiveSync. When a second
instance is registered, it replaces the first instance in the
registry.

When an ActiveSync connection is made, it starts Relay with the parameters that were
specified when Relay was configured.

Important When the ActiveSync connection is broken, all instances


of Relay stop.

For example, if the name of the computer running Microsoft Internet Information Services
(IIS) or the name of the proxy server is CorpServer, the options to run Relay are entered
at the command prompt as:

sscerelay /clientport 81 /servername CorpServer /serverport 80 /register

In the preceding example:

● The mobile device posts requests to and listens for responses on port 81 of the desktop computer.
● The desktop computer listens for requests from the client on port 81 and forwards them to port 80 of the server
that is specified by the /servername option. The desktop computer then listens for responses from the server on
port 81 and posts them to the client on port 81.
● If the computer that is specified in the /servername option is an IIS server, its name must match the server
name that is supplied in the InternetURL property of the Microsoft ActiveX® control on the mobile device. SQL
Server CE Server Tools must be installed on the computer and the SQL Server CE Server Agent configured on it. If
the computer that is specified in the /servername option is a proxy server, it does not require SQL Server CE
Server Tools or the SQL Server CE Server Agent because it forwards requests to an appropriately configured
computer running IIS (the one that is specified in the InternetURL property on the mobile device).
● The /register option registers Relay to run every time an ActiveSync connection is made.

Note The InternetProxyServer property must be set


to ppp_peer:81 in the SQL Server CE ActiveX control on
the Microsoft Windows CE-based device.

Use the /unregister option at the command prompt to unregister Relay from ActiveSync,
as shown here:

sscerelay /unregister

This removes the registry keys from Windows CE Services.

http://msdn.microsoft.com/library/default.asp?url=...e_registering_relay_with_activesync_to_run_774.asp (1 of 2) [22/07/2004 05:00:14 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=...e_registering_relay_with_activesync_to_run_774.asp (2 of 2) [22/07/2004 05:00:14 p.m.]


Running a Single Instance of SQL Server CE Relay Manually (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Running SQL Server CE Relay

SQL Server CE Books Online

Running a Single Instance of SQL Server CE Relay


Manually
If SQL Server CE Relay is to be used infrequently, you can run the program from the command prompt each time it is needed, as long as the mobile
device is connected to the desktop computer using Microsoft® ActiveSync®. When Relay is run from the command prompt without specifying the
/register option, it starts immediately. For example, if the name of the computer running Microsoft Internet Information Services (IIS) or the name of
the proxy server is CorpServer, the options to run Relay manually are entered at the command prompt as:

sscerelay /clientport 81 /servername CorpServer /serverport 80

When Relay is run manually, it also must be stopped manually. Use the /stop option at the command prompt to halt Relay, as shown here:

sscerelay /stop

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...ng_a_single_instance_of_sql_server__14.asp?frame=true [22/07/2004 05:00:18 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay > Running SQL Server CE Relay
Advanced Search

SQL Server CE Books Online

Running a Single Instance of


SQL Server CE Relay Manually
Up One Level If SQL Server CE Relay is to be used infrequently, you can run the program from the
command prompt each time it is needed, as long as the mobile device is connected to the
Registering SQL Server CE Relay with ActiveSync to Run Automatically desktop computer using Microsoft® ActiveSync®. When Relay is run from the command
prompt without specifying the /register option, it starts immediately. For example, if the
Running a Single Instance of SQL Server CE Relay Manually name of the computer running Microsoft Internet Information Services (IIS) or the name of
the proxy server is CorpServer, the options to run Relay manually are entered at the
Running Multiple Instances of SQL Server CE Relay Manually command prompt as:

sscerelay /clientport 81 /servername CorpServer /serverport 80

When Relay is run manually, it also must be stopped manually. Use the /stop option at the
command prompt to halt Relay, as shown here:

sscerelay /stop

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib...m/_lce_running_a_single_instance_of_sql_server__14.asp [22/07/2004 05:00:21 p.m.]


Running Multiple Instances of SQL Server CE Relay Manually (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Configuring Security for Connectivity > Using SQL Server CE Relay > Running SQL Server CE Relay

SQL Server CE Books Online

Running Multiple Instances of SQL Server CE Relay


Manually
When you run multiple instances of SQL Server CE Relay simultaneously, different client ports must be used. Because only one instance of Relay can be
registered with Microsoft® ActiveSync®, you must configure Relay manually to run multiple instances. For example, you might have to run multiple
instances of Relay if multiple server destinations are required. When two groups of applications are connecting to the same desktop computer for
synchronization, one application might need to connect to ServerA, which is a computer running Microsoft Internet Information Services (IIS) on the
intranet and, therefore, does not require a proxy server. The other application, on the other hand, might need to connect to ServerB, which is a computer
running IIS on the Internet and, therefore, does require a proxy server. In this scenario, one client port number maps to ServerA and the other client
port number maps to ServerB, which requires configuring two instances of Relay.

Note For computers running Microsoft Windows® 98 SE, the number of instances of Relay is limited to 20.

Using the /stop option at the command prompt halts all instances of Relay that are running.

Note Although you can configure multiple instances of SQL Server Relay on one computer, you can synchronize only one Microsoft
Windows CE-based device at a time.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...g_multiple_instances_of_sql_server_760.asp?frame=true [22/07/2004 05:00:27 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Configuring Security for Connectivity > Using SQL Server CE Relay > Running SQL Server CE Relay
Advanced Search

SQL Server CE Books Online

Running Multiple Instances of


SQL Server CE Relay Manually
Up One Level When you run multiple instances of SQL Server CE Relay simultaneously, different client
ports must be used. Because only one instance of Relay can be registered with Microsoft®
Registering SQL Server CE Relay with ActiveSync to Run Automatically ActiveSync®, you must configure Relay manually to run multiple instances. For example,
you might have to run multiple instances of Relay if multiple server destinations are
Running a Single Instance of SQL Server CE Relay Manually required. When two groups of applications are connecting to the same desktop computer for
synchronization, one application might need to connect to ServerA, which is a computer
Running Multiple Instances of SQL Server CE Relay Manually running Microsoft Internet Information Services (IIS) on the intranet and, therefore, does
not require a proxy server. The other application, on the other hand, might need to connect
to ServerB, which is a computer running IIS on the Internet and, therefore, does require a
proxy server. In this scenario, one client port number maps to ServerA and the other client
port number maps to ServerB, which requires configuring two instances of Relay.

Note For computers running Microsoft Windows® 98 SE, the


number of instances of Relay is limited to 20.

Using the /stop option at the command prompt halts all instances of Relay that are
running.

Note Although you can configure multiple instances of SQL Server


Relay on one computer, you can synchronize only one Microsoft
Windows CE-based device at a time.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../_lce_running_multiple_instances_of_sql_server_760.asp [22/07/2004 05:00:30 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0
MSDN Library Go
Advanced Search SQL Server CE Books Online
Working with SQL Server CE Databases

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) extends a subset of the database programming functionality of Microsoft SQL Server to
Microsoft Windows CE-based devices. You can create, access, and modify SQL Server databases programmatically in these devices using the SQL Server CE
database engine.

The following topics in this section describe the administrative and programmatic tasks involved when you work with SQL Server CE databases.
Up One Level
Understanding SQL Server CE Database Objects
Title Description
Designing and Maintaining SQL Server CE Databases
Understanding SQL Server CE Database Objects Describes the size limitations of SQL Server CE database objects.
Accessing SQL Server CE Databases Designing and Maintaining SQL Server CE Databases Describes the ways to create, secure, and maintain databases in SQL Server CE.

Using SQL Server CE Query Analyzer Accessing SQL Server CE Databases Describes how to query and modify databases in SQL Server CE.

Using SQL Server CE Query Analyzer Describes the user interface of SQL Server CE Query Analyzer and how you can use the interface to perform database tasks.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_server_ce_engine.asp [22/07/2004 05:01:10 p.m.]


Understanding SQL Server CE Database Objects (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases

SQL Server CE Books Online


Understanding SQL Server CE Database Objects

The following table specifies the maximum sizes and numbers for several database objects defined in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) databases. Use these specifications, while applying the same concepts about database design and programming that you use in SQL Server, when you
work with SQL Server CE databases.

Category Object Maximum size limitations


Storage Column name 128 characters

Columns in a table 255

Database password 40 characters

Database size 2.14 gigabytes (GB)

Database size increase 1-page to 16-page increments, depending on table size

Identifier length 128

Page size 4 kilobytes (KB)

Sessions 1

Size of BLOB (ntext and image) column 1.07 GB

Table name 128 characters

Table size 2.14 GB

Queries Characters in an SQL statement Unlimited

Columns in a cursor 255

Columns in a query Unlimited

Columns in an ORDER BY clause 255

Levels of nested subqueries Unlimited

Named parameters Not supported

Operands in a query Unlimited

Tables in a join Unlimited

Indexes BLOB columns Cannot be indexed

Note For every PRIMARY KEY, FOREIGN


KEY, and UNIQUE constraint defined on a
table, an index is created on those columns.
Additionally, for every FOREIGN KEY
constraint, the engine creates internally an
index on the referenced table. These indexes
all count against the total number of indexes
allowed for a table.

Bytes in an index key 510

Columns in an index 10

Indexes per table 249

Constraints PRIMARY KEY, UNIQUE, and FOREIGN KEY Supported

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_sql_server_ce_engine_limitations_705.asp?frame=true [22/07/2004 05:01:14 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases
MSDN Library Go
Advanced Search SQL Server CE Books Online
Understanding SQL Server CE Database Objects

The following table specifies the maximum sizes and numbers for several database objects defined in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) databases. Use these specifications, while applying the same concepts about database design and programming that you use in SQL Server, when you
work with SQL Server CE databases.

Up One Level Category Object Maximum size limitations


Storage Column name 128 characters
Understanding SQL Server CE Database Objects Columns in a table 255

Designing and Maintaining SQL Server CE Databases Database password 40 characters

Accessing SQL Server CE Databases


Database size 2.14 gigabytes (GB)

Database size increase 1-page to 16-page increments, depending on table size

Using SQL Server CE Query Analyzer Identifier length 128

Page size 4 kilobytes (KB)

Sessions 1

Size of BLOB (ntext and image) column 1.07 GB

Table name 128 characters

Table size 2.14 GB

Queries Characters in an SQL statement Unlimited

Columns in a cursor 255

Columns in a query Unlimited

Columns in an ORDER BY clause 255

Levels of nested subqueries Unlimited

Named parameters Not supported

Operands in a query Unlimited

Tables in a join Unlimited

Indexes BLOB columns Cannot be indexed

Note For every PRIMARY KEY, FOREIGN


KEY, and UNIQUE constraint defined on a
table, an index is created on those columns.
Additionally, for every FOREIGN KEY
constraint, the engine creates internally an
index on the referenced table. These indexes
all count against the total number of indexes
allowed for a table.

Bytes in an index key 510

Columns in an index 10

Indexes per table 249

Constraints PRIMARY KEY, UNIQUE, and FOREIGN KEY Supported

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_server_ce_engine_limitations_705.asp [22/07/2004 05:01:16 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Designing and Maintaining SQL Server CE Databases

The following topics in this section describe the administrative-related tasks relating to
databases in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE):

Up One Level ● Creating a Database


Using SQL Server CE Temporary Databases
Creating a Database

● Using the SQL Server CE Database Security Features


Maintaining SQL Server CE Databases
Using SQL Server CE Temporary Databases

Using the SQL Server CE Database Security Features


Maintaining SQL Server CE Databases

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li...designing_and_maintaining_sql_server_ce_databases.asp [22/07/2004 05:01:22 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining
SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Creating a Database

With Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE), you
must be connected to an existing database before you can create a new database
using the SQL CREATE DATABASE syntax. For more information, see CREATE
DATABASE.
Up One Level
Creating a Database Through ADOXCE
You can create a new SQL Server CE database by using one of the following
Creating a Database Through OLE DB methods:

Creating a Database Through the AddSubscription Method in Replication


● Using SQL Server CE Query Analyzer
● Creating a Database Through ADOXCE
● Creating a Database Through OLE DB
● Creating a Database Through the AddSubscription Method in Replication

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_creating_a_database.asp [22/07/2004 05:01:26 p.m.]


Creating a Database Through ADOXCE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Creating a Database

SQL Server CE Books Online

Creating a Database Through ADOXCE


To create a database through Microsoft® ActiveX® Data Objects Extensions for Data Definition Language (DDL) and Security (ADOXCE), use the Catalog
object. The Catalog object exposes the Create method, which takes an OLE DB connection string. For more information about ADOXCE, see the Microsoft
ActiveX Data Objects Extensions for Windows® CE 3.1 documentation at this Microsoft Web site.

Dim cat As ADOXCE.Catalog


Set cat = CreateObject("ADOXCE.Catalog.3.1")
cat.Create "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf"

All databases created without specifying a locale identifier (LCID) are assigned the default locale identifier, 1033 (0x00000409) for U.S. English. To create
a database with a locale identifier different from the default, specify the locale identifier. For example:

cat.Create "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\test2.sdf;Locale Identifier=1041"

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...reating_a_database_through_adoxce_705.asp?frame=true [22/07/2004 05:01:31 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE
MSDN Library Go Databases > Designing and Maintaining SQL Server CE Databases > Creating a Database

Advanced Search
SQL Server CE Books Online

Creating a Database Through ADOXCE


To create a database through Microsoft® ActiveX® Data Objects Extensions for Data Definition Language (DDL)
and Security (ADOXCE), use the Catalog object. The Catalog object exposes the Create method, which takes
an OLE DB connection string. For more information about ADOXCE, see the Microsoft ActiveX Data Objects
Extensions for Windows® CE 3.1 documentation at this Microsoft Web site.
Up One Level
Creating a Database Through ADOXCE Dim cat As ADOXCE.Catalog
Creating a Database Through OLE DB Set cat = CreateObject("ADOXCE.Catalog.3.1")
cat.Create "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf"
Creating a Database Through the AddSubscription Method in Replication
All databases created without specifying a locale identifier (LCID) are assigned the default locale identifier, 1033
(0x00000409) for U.S. English. To create a database with a locale identifier different from the default, specify
the locale identifier. For example:

cat.Create "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\test2.sdf;Locale Identifier=1041"

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_creating_a_database_through_adoxce_705.asp [22/07/2004 05:01:34 p.m.]


Creating a Database Through OLE DB (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Creating a Database

SQL Server CE Books Online

Creating a Database Through OLE DB


The OLE DB Provider for SQL Server CE supports programmatically creating databases in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE). For more information and an OLE DB programming example, see Creating Databases.

See Also

Programming OLE DB Applications for SQL Server CE

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...ing_a_database_through_ole_db47ce_533.asp?frame=true [22/07/2004 05:01:38 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining
SQL Server CE Databases > Creating a Database
Advanced Search

SQL Server CE Books Online

Creating a Database Through


OLE DB
Up One Level The OLE DB Provider for SQL Server CE supports programmatically creating
databases in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
Creating a Database Through ADOXCE For more information and an OLE DB programming example, see Creating Databases.

Creating a Database Through OLE DB


Creating a Database Through the AddSubscription Method in Replication
See Also

Programming OLE DB Applications for SQL Server CE

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_creating_a_database_through_ole_db47ce_533.asp [22/07/2004 05:01:44 p.m.]


Creating a Database Through the AddSubscription Method in Replication (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Creating a Database

SQL Server CE Books Online

Creating a Database Through the AddSubscription


Method in Replication
The AddSubscription method of the Replication object creates a new anonymous subscription to an existing publication. The CREATE_DATABASE option
using Microsoft® eMbedded Visual Tools, or the CreateDatabase option using Microsoft Visual Studio® .NET, creates a new (empty) Microsoft SQL
Server™ 2000 Windows® CE Edition (SQL Server CE) database on a Windows CE-based device. This method can be used to create SQL Server CE
databases whether or not you are using merge replication to synchronize data.

For more information, see AddSubscription Method.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_..._a_database_through_the_addsubsc_579.asp?frame=true [22/07/2004 05:01:50 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining
SQL Server CE Databases > Creating a Database
Advanced Search

SQL Server CE Books Online

Creating a Database Through


the AddSubscription Method
in Replication
Up One Level
Creating a Database Through ADOXCE The AddSubscription method of the Replication object creates a new anonymous
subscription to an existing publication. The CREATE_DATABASE option using
Creating a Database Through OLE DB Microsoft® eMbedded Visual Tools, or the CreateDatabase option using Microsoft
Visual Studio® .NET, creates a new (empty) Microsoft SQL Server™ 2000 Windows®
Creating a Database Through the AddSubscription Method in Replication CE Edition (SQL Server CE) database on a Windows CE-based device. This method
can be used to create SQL Server CE databases whether or not you are using merge
replication to synchronize data.

For more information, see AddSubscription Method.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_creating_a_database_through_the_addsubsc_579.asp [22/07/2004 05:01:53 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining
SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Using SQL Server CE Temporary Databases

During execution, Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE) creates a temporary database that it uses for storing temporary data such as:

Up One Level ● Pages that are part of an open transaction that no longer fits in the SQL Server CE cache buffer.
Interim result sets that are created during a query.

Specifying the Location of the Temporary Database in a Smart Device Application


● Interim sort tables that are created when executing an ORDER BY clause.

Specifying the Location of the Temporary Database Using ADOCE


The temporary database is created when the SQL Server CE database engine starts,
Specifying the Location of the Temporary Database Using the Replication and RDA Controls and it is removed when the database engine is shut down in a predictable manner.
Abnormal termination of a SQL Server CE application leaves temporary database
files that must be manually removed. Unless a new location for the temporary
database has been assigned, these files can be found in the \TEMP directory and
have file names that begin with SQLCE, for example, SQLCE334241234.tmp.

Growth of the Temporary Database

During execution, once its buffer cache is full, the SQL Server CE database engine
dynamically allocates resources to the temporary database. Large databases can
generate large amounts of temporary data during normal execution. When the
temporary database grows to the point that there is insufficient storage space on the
default storage device, the application fails.

The following operations cause growth in the temporary database, particularly when
they are wrapped in a single transaction:

● UPDATE and DELETE statements.


● Explicit transactions.
● Sort operations: Sorting is required when indexes are created and also when statements that include the
ORDER BY or GROUP BY clause are executed.

Location of the Temporary Database

To prevent large database files from growing beyond the storage limits of the device,
it is possible to store databases on a storage card rather than in internal RAM. Even
when user databases are moved to a storage card, the temporary database is always
created by default in the \TEMP directory of the device, which uses internal RAM.

For operations requiring a large temporary database, you can specify a location
different from the default \TEMP directory for the temporary database. The new
location for the temporary database is usually on a storage card.

Because the temporary database is created when the database engine starts, the
location of the temporary database must be specified prior to the engine being
started and cannot be changed when the engine is running. The location of the
temporary database can be changed when the database is compacted.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_server_ce_temporary_database_705.asp (1 of 2) [22/07/2004 07:13:31 p.m.]


Welcome to the MSDN Library
You can specify the location of the temporary database in the following ways:

● Specifying the Location of the Temporary Database in a Smart Device Application


● Specifying the Location of the Temporary Database Using ADOCE
● Specifying the Location of the Temporary Database Using the Replication and RDA Controls
● Specifying the Location of the Temporary Database Using OLE DB

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_server_ce_temporary_database_705.asp (2 of 2) [22/07/2004 07:13:31 p.m.]


Specifying the Location of the Temporary Database in a Smart Device Application (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using SQL Server CE
Temporary Databases

SQL Server CE Books Online

Specifying the Location of the Temporary Database


in a Smart Device Application
Using Microsoft® .NET Compact Framework Data Provider for SQL Server CE, you can explicitly specify the location of the temporary database by adding
the temp file directory property to the SqlCeConnection.ConnectionString object that is passed to SqlCeConnection as follows:

"temp file directory = temp_database_location;"

Note Property values in the connection string can be specified in any order and must be separated by semicolons.

You can also specify the temporary database location in the destConnect connection string when calling the SqlCeEngine.Compact method.

Examples

The following Microsoft C# example shows how to pass the temporary database location in the connection string of the SqlCeConnection object.

SqlCeConnection conn = new SqlCeConnection();


conn.ConnectionString = "Persist Security Info=False; Data Source =
Northwind.sdf; temp file directory = temp_database_location;"

conn.Open();

The following Microsoft Visual Basic® example shows how to pass the temporary database location in the connection string of the SqlCeConnection
object.

Dim conn As New SqlCeConnection()


conn.ConnectionString = "Persist Security Info=False; Data Source = " + _
"Northwind.sdf; temp file directory = temp_database_location;"

conn.Open()

For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual Studio®
.NET.

See Also

Using SQL Server CE Temporary Databases

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...ying_the_location_of_the_temporary_705.asp?frame=true [22/07/2004 07:13:46 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining
SQL Server CE Databases > Using SQL Server CE Temporary Databases
Advanced Search

SQL Server CE Books Online

Specifying the Location of


the Temporary Database in a
Smart Device Application
Up One Level
Specifying the Location of the Temporary Database in a Smart Device Application Using Microsoft® .NET Compact Framework Data Provider for SQL Server CE, you
can explicitly specify the location of the temporary database by adding the temp file
Specifying the Location of the Temporary Database Using ADOCE directory property to the SqlCeConnection.ConnectionString object that is
passed to SqlCeConnection as follows:
Specifying the Location of the Temporary Database Using the Replication and RDA Controls

"temp file directory = temp_database_location;"

Note Property values in the connection string can be


specified in any order and must be separated by semicolons.

You can also specify the temporary database location in the destConnect connection
string when calling the SqlCeEngine.Compact method.

Examples

The following Microsoft C# example shows how to pass the temporary database
location in the connection string of the SqlCeConnection object.

SqlCeConnection conn = new SqlCeConnection();


conn.ConnectionString = "Persist Security Info=False; Data Source =
Northwind.sdf; temp file directory = temp_database_location;"

conn.Open();

The following Microsoft Visual Basic® example shows how to pass the temporary
database location in the connection string of the SqlCeConnection object.

Dim conn As New SqlCeConnection()


conn.ConnectionString = "Persist Security Info=False; Data Source = " + _
"Northwind.sdf; temp file directory = temp_database_location;"

conn.Open()

For more information, see the System.Data.SqlServerCe.SqlCeConnection class


in the .NET Compact Framework SDK in Microsoft Visual Studio® .NET.

See Also

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_specifying_the_location_of_the_temporary_705.asp (1 of 2) [22/07/2004 07:13:48 p.m.]


Welcome to the MSDN Library

Using SQL Server CE Temporary Databases

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_specifying_the_location_of_the_temporary_705.asp (2 of 2) [22/07/2004 07:13:48 p.m.]


Specifying the Location of the Temporary Database Using ADOCE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using SQL Server CE
Temporary Databases

SQL Server CE Books Online

Specifying the Location of the Temporary Database


Using ADOCE
Using Microsoft® ActiveX® Data Objects for Windows® CE (ADOCE), you can explicitly specify the location of the temporary database by adding the
following value to the connection string that is passed by the Connection.Open method:

"SSCE:Temp File Directory = temp_database_location"

Note Property values in ADOCE connection strings must be separated by semicolons, and the location of the temporary database
path inside the connection string is not important.

You can also specify the temporary database location in the connection string when calling the Engine.CompactDatabase method.

Examples

The following Microsoft Visual Basic® example shows how to pass the temporary database location in the connection string using ADOCE.

Dim cn As ADOCE.Connection
Set cn = CreateObject("ADOCE.Connection.3.1")
cn.ConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data "
+ " source=\Northwind.sdf; SSCE:Temp File Directory = temp_database_location"
cn.Open

See Also

CompactDatabase Method

Using SQL Server CE Temporary Databases

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...ying_the_location_of_the_temporary_289.asp?frame=true [22/07/2004 07:13:54 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System >
Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000
MSDN Library Go Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining
SQL Server CE Databases > Using SQL Server CE Temporary Databases
Advanced Search

SQL Server CE Books Online

Specifying the Location of the


Temporary Database Using
ADOCE
Up One Level
Specifying the Location of the Temporary Database in a Smart Device Application Using Microsoft® ActiveX® Data Objects for Windows® CE (ADOCE), you can explicitly
specify the location of the temporary database by adding the following value to the
Specifying the Location of the Temporary Database Using ADOCE connection string that is passed by the Connection.Open method:

Specifying the Location of the Temporary Database Using the Replication and RDA Controls
"SSCE:Temp File Directory = temp_database_location"

Note Property values in ADOCE connection strings must be


separated by semicolons, and the location of the temporary
database path inside the connection string is not important.

You can also specify the temporary database location in the connection string when
calling the Engine.CompactDatabase method.

Examples

The following Microsoft Visual Basic® example shows how to pass the temporary
database location in the connection string using ADOCE.

Dim cn As ADOCE.Connection
Set cn = CreateObject("ADOCE.Connection.3.1")
cn.ConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data "
+ " source=\Northwind.sdf; SSCE:Temp File Directory = temp_database_location"
cn.Open

See Also

CompactDatabase Method

Using SQL Server CE Temporary Databases

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_specifying_the_location_of_the_temporary_289.asp (1 of 2) [22/07/2004 07:13:58 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_specifying_the_location_of_the_temporary_289.asp (2 of 2) [22/07/2004 07:13:58 p.m.]


Specifying the Location of the Temporary Database Using the Replication and RDA Controls (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using SQL Server CE Temporary
Databases

SQL Server CE Books Online

Specifying the Location of the Temporary Database


Using Replication and RDA Controls
You can explicitly specify the location of the temporary database by using both the Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE)
Replication and Remote Data Access (RDA) ActiveX® control objects by adding the following value at the end of the connection string:

"SSCE:Temp File Directory = temp_database_location"

Note Property values in the connection string must be separated by semicolons, and the location of the temporary database path
inside the connection string is not important.

For the Replication object, you must include the temporary database location for all methods that use a SubscriberConnectionString property. These methods
are:

● REPL_Object.Initialize
● REPL_Object.AddSubscription
● REPL_Object.Run
● REPL_Object.ReinitializeSubscription
● REPL_Object.DropSubscription

For the RDA object, you must include the temporary database location for all methods that use a LocalConnectionString property. These methods are:

● RDA_Object.Pull
● RDA_Object.Push

Examples

A. Using the SubscriberConnectionString property in the Replication object

The following Microsoft Visual Basic® example shows how to use the SubscriberConnectionString property in the SQL Server CE ActiveX Control Replication
object.

' Declare the Replication object.


Dim ceRepl As SSCE.Replication

' Create the Replication object.


Set ceRepl = CreateObject("SSCE.Replication.2.0")

' Set Internet properties.


ceRepl.InternetURL = "http://www.northwindtraders.com/sqlce/sscesa20.dll"
ceRepl.InternetLogin = "MyInternetLogin"
ceRepl.InternetPassword = "<MyInternetPassword>"

' Set Publisher properties.


ceRepl.Publisher = "SamplePublisher"
ceRepl.PublisherDatabase = "Nwind_SQLCEReplDemo"
ceRepl.Publication = "SQLCEReplDemo"
ceRepl.PublisherSecurityMode = DB_AUTHENTICATION
ceRepl.PublisherLogin = "MySqlPublisherLogin"
ceRepl.PublisherPassword = "<MySqlPublisherPassword>"

' Set Subscriber properties.


ceRepl.SubscriberConnectionString = "data source=\NorthwindRepl.sdf;SSCE:Temp File Directory =temp_database_location"
ceRepl.Subscriber = "SQLCE Sub #1"

' Create the new anonymous subscription.


ceRepl.AddSubscription CREATE_DATABASE

B. Using the LocalConnectionString property in the RDA object

http://msdn.microsoft.com/library/en-us/sqlce/htm..._the_location_of_the_temporary_301.asp?frame=true (1 of 2) [22/07/2004 07:14:04 p.m.]


Specifying the Location of the Temporary Database Using the Replication and RDA Controls (SQL Server CE Books Online)

The following Visual Basic example shows how to use the LocalConnectionString property in the SQL Server CE RDA ActiveX control object.

' Declare the SQL Server CE RDA ActiveX control object.


Dim ceRDA As SSCE.RemoteDataAccess

' Create the RDA object.


Set ceRDA = CreateObject("SSCE.RemoteDataAccess.2.0")

' Set RDA properties.


ceRDA .InternetURL = "http://www.northwindtraders.com/sqlce/sscesa20.dll"
ceRDA .InternetLogin = "MyInternetLogin"
ceRDA .InternetPassword = "<MyInternetPassword>"
ceRDA .LocalConnectionString = "Data Source=\NorthwindRDA.sdf;SSCE:Temp File Directory =temp_database_location"

' Push the tracked SQL Server CE table changes back to the SQL Server table.
ceRDA .Push "Customers", "Provider=sqloledb;Data Source=SampleServer;Initial Catalog=Northwind;user id=SampleUser;password=<SamplePassword>"

See Also

CompactDatabase Method

Using SQL Server CE Temporary Databases

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm..._the_location_of_the_temporary_301.asp?frame=true (2 of 2) [22/07/2004 07:14:04 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server
2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases >
MSDN Library Go Designing and Maintaining SQL Server CE Databases > Using SQL Server CE Temporary Databases

Advanced Search
SQL Server CE Books Online

Specifying the Location of the Temporary


Database Using Replication and RDA
Controls
Up One Level
You can explicitly specify the location of the temporary database by using both the Microsoft® SQL Server™ 2000
Specifying the Location of the Temporary Database in a Smart Device Application Windows® CE Edition (SQL Server CE) Replication and Remote Data Access (RDA) ActiveX® control objects by adding the
following value at the end of the connection string:
Specifying the Location of the Temporary Database Using ADOCE
Specifying the Location of the Temporary Database Using the Replication and RDA Controls
"SSCE:Temp File Directory = temp_database_location"

Note Property values in the connection string must be separated by semicolons, and the location of
the temporary database path inside the connection string is not important.

For the Replication object, you must include the temporary database location for all methods that use a
SubscriberConnectionString property. These methods are:

● REPL_Object.Initialize
● REPL_Object.AddSubscription
● REPL_Object.Run
● REPL_Object.ReinitializeSubscription
● REPL_Object.DropSubscription

For the RDA object, you must include the temporary database location for all methods that use a LocalConnectionString
property. These methods are:

● RDA_Object.Pull
● RDA_Object.Push

Examples

A. Using the SubscriberConnectionString property in the Replication object

The following Microsoft Visual Basic® example shows how to use the SubscriberConnectionString property in the SQL Server
CE ActiveX Control Replication object.

' Declare the Replication object.


Dim ceRepl As SSCE.Replication

' Create the Replication object.


Set ceRepl = CreateObject("SSCE.Replication.2.0")

' Set Internet properties.


ceRepl.InternetURL = "http://www.northwindtraders.com/sqlce/sscesa20.dll"
ceRepl.InternetLogin = "MyInternetLogin"
ceRepl.InternetPassword = "<MyInternetPassword>"

' Set Publisher properties.


ceRepl.Publisher = "SamplePublisher"
ceRepl.PublisherDatabase = "Nwind_SQLCEReplDemo"
ceRepl.Publication = "SQLCEReplDemo"
ceRepl.PublisherSecurityMode = DB_AUTHENTICATION
ceRepl.PublisherLogin = "MySqlPublisherLogin"
ceRepl.PublisherPassword = "<MySqlPublisherPassword>"

' Set Subscriber properties.


ceRepl.SubscriberConnectionString = "data source=\NorthwindRepl.sdf;SSCE:Temp File Directory
=temp_database_location"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_specifying_the_location_of_the_temporary_301.asp (1 of 2) [22/07/2004 07:14:06 p.m.]


Welcome to the MSDN Library
ceRepl.Subscriber = "SQLCE Sub #1"

' Create the new anonymous subscription.


ceRepl.AddSubscription CREATE_DATABASE

B. Using the LocalConnectionString property in the RDA object

The following Visual Basic example shows how to use the LocalConnectionString property in the SQL Server CE RDA ActiveX
control object.

' Declare the SQL Server CE RDA ActiveX control object.


Dim ceRDA As SSCE.RemoteDataAccess

' Create the RDA object.


Set ceRDA = CreateObject("SSCE.RemoteDataAccess.2.0")

' Set RDA properties.


ceRDA .InternetURL = "http://www.northwindtraders.com/sqlce/sscesa20.dll"
ceRDA .InternetLogin = "MyInternetLogin"
ceRDA .InternetPassword = "<MyInternetPassword>"
ceRDA .LocalConnectionString = "Data Source=\NorthwindRDA.sdf;SSCE:Temp File Directory =temp_database_location"

' Push the tracked SQL Server CE table changes back to the SQL Server table.
ceRDA .Push "Customers", "Provider=sqloledb;Data Source=SampleServer;Initial Catalog=Northwind;user
id=SampleUser;password=<SamplePassword>"

See Also

CompactDatabase Method

Using SQL Server CE Temporary Databases

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_specifying_the_location_of_the_temporary_301.asp (2 of 2) [22/07/2004 07:14:06 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Using the SQL Server CE Database Security Features

The primary security systems for Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) are provided by the connectivity features of the product. For more information
about secure connectivity, see Planning for Security.

Up One Level
Password Protecting SQL Server CE Databases In addition to the connectivity security options, the SQL Server CE database engine provides
two additional features for securing local databases on a Windows CE-based device. These
Encrypting SQL Server CE Databases features are the ability to password protect databases and encrypt databases. For more
information, see Password Protecting SQL Server CE Databases and Encrypting SQL Server
Changing Passwords and Encryption Settings for a Database CE Databases.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_creating_secure_databases.asp [22/07/2004 07:14:30 p.m.]


Password Protecting SQL Server CE Databases (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using the SQL Server
CE Database Security Features

SQL Server CE Books Online

Password Protecting SQL Server CE Databases


The Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) database engine allows you to require that a password be supplied when
accessing a local database. In SQL Server CE, one password is created for the database that is being secured. A password is not created for each user of a
database. Passwords for SQL Server CE databases:

● Can be up to 40 characters long.


● Can contain letters, symbols, digits, or a combination.
● Cannot be recovered.

Note The password does not prevent the reading of any data in the database file as clear text. By using both
encryption and a password, you can store the data in an encrypted format and restrict programmatic access to the
database.

Creating Password-protected Databases

Password-protected databases are created by supplying a password property when the database is created. Password-protected databases can be created
by the following methods:

● Using SQL Syntax

To create a password-protected database through SQL syntax, specify database_password in the CREATE DATABASE statement. The password must follow the DATABASEPASSWORD keyword and be
enclosed in single quotation marks as in the following example:

Create Database "secure.sdf" databasepassword '<myPassword>'

● Using the .NET Compact Framework Data Provider for SQL Server CE

To create a password-protected database using the SqlCeEngine.CreateDatabase method, you must specify the password property in the connection string as in the following example:

"data source=\NorthWind.sdf; password=<myPassword>"

For more information, see the System.Data.SqlServerCe.SqlCeEngine class in the .NET Compact Framework SDK in Microsoft Visual Studio® .NET.

● Using Microsoft ActiveX® Data Objects for Windows CE (ADOCE), Microsoft ActiveX Data Objects Extensions for Data Definition Language (DDL) and Security (ADOXCE), or the Replication object

To create a password-protected database using the either the ADOCE or ADOXCE Catalog object, or the AddSubscription method of the SQL Server CE Replication ActiveX object, you must specify the
provider-specific SSCE:Database Password connection property in the connection string. For example:

"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=<myPassword>"

● Using OLE DB

For more information, see Creating Databases.

Accessing Password-protected Databases

A password must be supplied to open a password-protected database. Password-protected databases can be accessed by the following methods:

● Using the data provider for SQL Server CE

To access a password-protected database using the SqlCeConnection.Open method, you must specify the password property in the connection string. For example:

http://msdn.microsoft.com/library/en-us/sqlce/ht...assword_protecting_databases__705.asp?frame=true (1 of 2) [22/07/2004 07:14:35 p.m.]


Password Protecting SQL Server CE Databases (SQL Server CE Books Online)

"data source=\NorthWind.sdf; password=<myPassword>"

For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual Studio .NET.

● Using ADOCE, ADOXCE, or the Replication object

To access a password-protected database using either the ADOCE or ADOXCE Catalog object, or the SQL Server CE Replication ActiveX object, you must specify the provider-specific SSCE:Database
Password connection property. For example:

"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=<myPassword>"

● Using OLE DB

For more information, see Accessing Password-protected Databases.

Changing the Database Password

After a password has been assigned to a database, it cannot be changed until the database is compacted. For more information, see Changing Passwords
and Encryption Settings for a Database.

See Also

Connecting to a SQL Server CE Database

SubscriberConnectionString Property

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/ht...assword_protecting_databases__705.asp?frame=true (2 of 2) [22/07/2004 07:14:35 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using the
Advanced Search SQL Server CE Database Security Features

SQL Server CE Books Online

Password Protecting SQL Server


CE Databases
Up One Level
The Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) database engine
Password Protecting SQL Server CE Databases allows you to require that a password be supplied when accessing a local database. In SQL
Server CE, one password is created for the database that is being secured. A password is not
Encrypting SQL Server CE Databases created for each user of a database. Passwords for SQL Server CE databases:

Changing Passwords and Encryption Settings for a Database


● Can be up to 40 characters long.
● Can contain letters, symbols, digits, or a combination.
● Cannot be recovered.

Note The password does not prevent the reading of any


data in the database file as clear text. By using both
encryption and a password, you can store the data in an
encrypted format and restrict programmatic access to the
database.

Creating Password-protected Databases

Password-protected databases are created by supplying a password property when the


database is created. Password-protected databases can be created by the following methods:

● Using SQL Syntax

To create a password-protected database through SQL syntax, specify database_password in the CREATE DATABASE
statement. The password must follow the DATABASEPASSWORD keyword and be enclosed in single quotation marks as
in the following example:

Create Database "secure.sdf" databasepassword '<myPassword>'

● Using the .NET Compact Framework Data Provider for SQL Server CE

To create a password-protected database using the SqlCeEngine.CreateDatabase method, you must specify the
password property in the connection string as in the following example:

"data source=\NorthWind.sdf; password=<myPassword>"

For more information, see the System.Data.SqlServerCe.SqlCeEngine class in the .NET Compact Framework SDK in
Microsoft Visual Studio® .NET.

● Using Microsoft ActiveX® Data Objects for Windows CE (ADOCE), Microsoft ActiveX Data Objects Extensions for Data
Definition Language (DDL) and Security (ADOXCE), or the Replication object

To create a password-protected database using the either the ADOCE or ADOXCE Catalog object, or the
AddSubscription method of the SQL Server CE Replication ActiveX object, you must specify the provider-specific
SSCE:Database Password connection property in the connection string. For example:

"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=<myPassword>"

● Using OLE DB

For more information, see Creating Databases.

Accessing Password-protected Databases

A password must be supplied to open a password-protected database. Password-protected


databases can be accessed by the following methods:

● Using the data provider for SQL Server CE

To access a password-protected database using the SqlCeConnection.Open method, you must specify the password
property in the connection string. For example:

"data source=\NorthWind.sdf; password=<myPassword>"

http://msdn.microsoft.com/library/default.asp?url...e/htm/_lce_password_protecting_databases__705.asp (1 of 2) [22/07/2004 07:14:38 p.m.]


Welcome to the MSDN Library

For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework
SDK in Microsoft Visual Studio .NET.

● Using ADOCE, ADOXCE, or the Replication object

To access a password-protected database using either the ADOCE or ADOXCE Catalog object, or the SQL Server CE
Replication ActiveX object, you must specify the provider-specific SSCE:Database Password connection property. For
example:

"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=<myPassword>"

● Using OLE DB

For more information, see Accessing Password-protected Databases.

Changing the Database Password

After a password has been assigned to a database, it cannot be changed until the database is
compacted. For more information, see Changing Passwords and Encryption Settings for a
Database.

See Also

Connecting to a SQL Server CE Database

SubscriberConnectionString Property

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url...e/htm/_lce_password_protecting_databases__705.asp (2 of 2) [22/07/2004 07:14:38 p.m.]


Encrypting SQL Server CE Databases (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using the SQL Server
CE Database Security Features

SQL Server CE Books Online

Encrypting SQL Server CE Databases


The Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) database engine allows you to encrypt databases. Databases that are
encrypted must also be protected with a database password.

Important Because encrypted databases can only be accessed with a password, if the password for an encrypted database is lost,
the data is essentially gone.

This encryption support is provided by Windows CE and is supported on all Pocket PC devices. To enable encryption on a Windows CE-based device, you
must install Rsaenh.dll (a dynamic-link library that implements the security features of SQL Server CE) on the Pocket PC device. This encryption
component is shipped with Handheld PC 2000 Service Pack 1 devices and is also available for download in the Microsoft High Encryption Pack, which can
be found at this Microsoft Web site.

Note Database encryption is not supported in Handheld PC 2000 or in the Windows CE emulation.

Creating Encrypted Databases

Encrypted databases are created by supplying both encryption and password properties when the database is created. Encrypted databases can be
created by the following methods:

● Using SQL Syntax

To create an encrypted database through SQL syntax, specify both database_password and the ENCRYPTION ON option. For example:

Create Database "secure.sdf" databasepassword '<password>' encryption on

● Using the .NET Compact Framework Data Provider for SQL Server CE

To create a password-protected database using the SqlCeEngine.CreateDatabase method, you must specify the password property in the connection string. For example:

"data source=\secure.sdf;password=<myPassword>;encrypt database=TRUE"

For more information, see the System.Data.SqlServerCe.SqlCeEngine class in the .NET Compact Framework SDK in Microsoft Visual Studio® .NET.

● Using Microsoft ActiveX® Data Objects for Windows CE (ADOCE), Microsoft ActiveX Data Objects Extensions for Data Definition Language (DDL) and Security (ADOXCE), or the Replication object

To create an encrypted database using either the ADOCE or ADOXCE Catalog object, or the AddSubscription method of the SQL Server CE Replication ActiveX object, you must specify both the provider-
specific SSCE:Database Password connection property and the provider-specific SSCE:Encrypt Database connection property. SSCE:Encrypt Database is a Boolean value that must be set to TRUE for
an encrypted database. For example:

"provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;data source=\secure.sdf;SSCE:Database Password=<myPassword>;SSCE:Encrypt Database=TRUE"

● Using OLE DB

For more information, see Creating Databases.

Accessing Encrypted Databases

A password must be supplied to open an encrypted database. Encrypted databases can be accessed by the following methods:

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_encrypting_databases_579.asp?frame=true (1 of 2) [22/07/2004 07:14:43 p.m.]


Encrypting SQL Server CE Databases (SQL Server CE Books Online)

● Using the data provider for SQL Server CE

To access a password-protected database using the SqlCeConnection.Open method, you must specify the password property in the connection string. For example:

"data source=\NorthWind.sdf; password=<myPassword>"

For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual Studio® .NET.

● Using ADOCE, ADOXCE, or the Replication object

To access a password-protected database using either the ADOCE or ADOXCE Catalog object, or the SQL Server CE Replication ActiveX object, you must specify the provider-specific SSCE:Database
Password connection property in the connection string. For example:

"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=<myPassword>"

● Using OLE DB

For more information, see Accessing Password-protected Databases.

Changing the Encryption Settings and Database Password

After an encryption setting and password have been assigned to a database, they cannot be changed until the database is compacted. For more
information, see Changing Passwords and Encryption Settings for a Database.

See Also

Connecting to a SQL Server CE Database

SubscriberConnectionString Property

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_encrypting_databases_579.asp?frame=true (2 of 2) [22/07/2004 07:14:43 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE
MSDN Library Go Databases > Designing and Maintaining SQL Server CE Databases > Using the SQL Server CE Database Security
Features
Advanced Search

SQL Server CE Books Online

Encrypting SQL Server CE Databases


The Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) database engine allows you to encrypt
databases. Databases that are encrypted must also be protected with a database password.

Up One Level
Password Protecting SQL Server CE Databases Important Because encrypted databases can only be accessed with a password, if the
password for an encrypted database is lost, the data is essentially gone.
Encrypting SQL Server CE Databases
Changing Passwords and Encryption Settings for a Database This encryption support is provided by Windows CE and is supported on all Pocket PC devices. To enable
encryption on a Windows CE-based device, you must install Rsaenh.dll (a dynamic-link library that implements
the security features of SQL Server CE) on the Pocket PC device. This encryption component is shipped with
Handheld PC 2000 Service Pack 1 devices and is also available for download in the Microsoft High Encryption
Pack, which can be found at this Microsoft Web site.

Note Database encryption is not supported in Handheld PC 2000 or in the Windows CE


emulation.

Creating Encrypted Databases

Encrypted databases are created by supplying both encryption and password properties when the database is
created. Encrypted databases can be created by the following methods:

● Using SQL Syntax

To create an encrypted database through SQL syntax, specify both database_password and the ENCRYPTION ON option. For example:

Create Database "secure.sdf" databasepassword '<password>' encryption on

● Using the .NET Compact Framework Data Provider for SQL Server CE

To create a password-protected database using the SqlCeEngine.CreateDatabase method, you must specify the password property in the
connection string. For example:

"data source=\secure.sdf;password=<myPassword>;encrypt database=TRUE"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_encrypting_databases_579.asp (1 of 3) [22/07/2004 07:14:46 p.m.]


Welcome to the MSDN Library
For more information, see the System.Data.SqlServerCe.SqlCeEngine class in the .NET Compact Framework SDK in Microsoft Visual Studio®
.NET.

● Using Microsoft ActiveX® Data Objects for Windows CE (ADOCE), Microsoft ActiveX Data Objects Extensions for Data Definition Language (DDL)
and Security (ADOXCE), or the Replication object

To create an encrypted database using either the ADOCE or ADOXCE Catalog object, or the AddSubscription method of the SQL Server CE
Replication ActiveX object, you must specify both the provider-specific SSCE:Database Password connection property and the provider-specific
SSCE:Encrypt Database connection property. SSCE:Encrypt Database is a Boolean value that must be set to TRUE for an encrypted database.
For example:

"provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;data source=\secure.sdf;SSCE:Database Password=<myPassword>;SSCE:Encrypt Database=TRUE"

● Using OLE DB

For more information, see Creating Databases.

Accessing Encrypted Databases

A password must be supplied to open an encrypted database. Encrypted databases can be accessed by the
following methods:

● Using the data provider for SQL Server CE

To access a password-protected database using the SqlCeConnection.Open method, you must specify the password property in the connection
string. For example:

"data source=\NorthWind.sdf; password=<myPassword>"

For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual
Studio® .NET.

● Using ADOCE, ADOXCE, or the Replication object

To access a password-protected database using either the ADOCE or ADOXCE Catalog object, or the SQL Server CE Replication ActiveX object,
you must specify the provider-specific SSCE:Database Password connection property in the connection string. For example:

"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=<myPassword>"

● Using OLE DB

For more information, see Accessing Password-protected Databases.

Changing the Encryption Settings and Database Password

After an encryption setting and password have been assigned to a database, they cannot be changed until the
database is compacted. For more information, see Changing Passwords and Encryption Settings for a Database.

See Also

Connecting to a SQL Server CE Database

SubscriberConnectionString Property

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_encrypting_databases_579.asp (2 of 3) [22/07/2004 07:14:46 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_encrypting_databases_579.asp (3 of 3) [22/07/2004 07:14:46 p.m.]


Changing Passwords and Encryption Settings for a Database (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using the SQL Server
CE Database Security Features

SQL Server CE Books Online

Changing Passwords and Encryption Settings for a


Database
Once the encryption or password properties on a database have been set, these properties can only be modified when the database is compacted. In
addition to setting these security properties on the database, compaction is primarily used to compress unused space in a database and to search for
database consistency errors. For more information, see Maintaining SQL Server CE Databases.

Compaction is exposed through the following mechanisms in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE):

● The Compact method of the SQL Server CE Database Engine ActiveX® control.

For more information, see CompactDatabase Method.

● The Compact method of the System.Data.Sqlserverce.SqlCeEngine class of the .NET Compact Framework Data Provider for SQL Server CE.

For more information, see .NET Compact Framework Data Providers.

● Directly through the OLE DB for SQL Server CE by using the ISSCECompact interface.

For more information, see ISSCECompact.

Note When compacting a password protected or encrypted database, you will need to specify the password for the original database.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l...g_passwords_and_encryption_settin_289.asp?frame=true [22/07/2004 07:15:01 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases > Using
Advanced Search the SQL Server CE Database Security Features

SQL Server CE Books Online

Changing Passwords and


Encryption Settings for a
Up One Level Database
Password Protecting SQL Server CE Databases
Encrypting SQL Server CE Databases Once the encryption or password properties on a database have been set, these properties
can only be modified when the database is compacted. In addition to setting these security
Changing Passwords and Encryption Settings for a Database properties on the database, compaction is primarily used to compress unused space in a
database and to search for database consistency errors. For more information, see
Maintaining SQL Server CE Databases.

Compaction is exposed through the following mechanisms in Microsoft® SQL Server™ 2000
Windows® CE Edition (SQL Server CE):

● The Compact method of the SQL Server CE Database Engine ActiveX® control.

For more information, see CompactDatabase Method.

● The Compact method of the System.Data.Sqlserverce.SqlCeEngine class of the .NET Compact Framework Data
Provider for SQL Server CE.

For more information, see .NET Compact Framework Data Providers.

● Directly through the OLE DB for SQL Server CE by using the ISSCECompact interface.

For more information, see ISSCECompact.

Note When compacting a password protected or encrypted database, you will


need to specify the password for the original database.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li..._lce_changing_passwords_and_encryption_settin_289.asp [22/07/2004 07:15:04 p.m.]


Maintaining SQL Server CE Databases (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server >
SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Working with SQL
Server CE Databases > Designing and Maintaining SQL Server CE Databases

SQL Server CE Books Online

Maintaining SQL Server CE


Databases
The internal structure of a database can become fragmented over time and, after much use, result in
wasted disk space. If the fragmentation is excessive, performance can deteriorate. To avoid fragmentation
and get better performance, use the compaction process to maintain the database.

Compacting a database performs the following tasks:

● Reorganizes a table's pages so they reside in adjacent database pages. This improves performance
by reducing table fragmentation across the database.
● Reorders table rows when there is a UNIQUE or PRIMARY KEY constraint present on the table.
● Reclaims unused space created by object and record deletions by rewriting all database data into
new data pages with no gaps in the page. When objects or records are deleted from the database,
the space they occupied is marked as available for new additions to the database. However, unless
an entire page of data has been deleted, the page remains in a partially filled state and the size of
the database does not shrink until either the final data is deleted from the page or the database is
compacted. For databases in which objects and records are frequently added, deleted, and updated,
you should compact frequently.
● Resets incrementing identity columns so the next value allocated will be one more than the highest
value in the remaining records. For example, if all records in the database have been deleted,
compacting the database sets the value of the identity column of the next record to 1. If the highest
remaining identity value in the database is 50, compacting the database sets the value of the next
record to 51. Note that this is true even if records containing values greater than 50 were added
previously but were deleted prior to compacting.
● Regenerates the table statistics used in the query optimization process. These statistics can become
out-of-date when much time has elapsed, when transactions are rolled back, and when the
database was not properly closed due to power loss or failure to completely exit the program before
turning the computer off.
● Repairs a suspect database.
● Modifies database properties.

Before compacting a database, ensure that the following conditions are met:

● The database must not be open.


● The source and destination database path must be different.

The destination database must not exist when CompactDatabase is called. An error occurs if the
database specified by DestConnection already exists or another file with that name already exists.
● Sufficient storage space must exist for both the original and compacted versions of the database, as
well as any cached data and data stored in the temporary database.

When a database is compacted, the following database properties can be modified:

● Password

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_maintaining_your_database.asp?frame=true (1 of 2) [22/07/2004 07:16:54 p.m.]


Maintaining SQL Server CE Databases (SQL Server CE Books Online)

● Whether or not the database is encrypted


● Locale identifier

See Also

CompactDatabase Method

ISSCECompact

Using SQL Server CE Query Analyzer

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_maintaining_your_database.asp?frame=true (2 of 2) [22/07/2004 07:16:54 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Designing and Maintaining SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Maintaining SQL Server CE Databases

The internal structure of a database can become fragmented over time and, after much use,
result in wasted disk space. If the fragmentation is excessive, performance can deteriorate.
To avoid fragmentation and get better performance, use the compaction process to
maintain the database.
Up One Level
Creating a Database Compacting a database performs the following tasks:

Using SQL Server CE Temporary Databases


Using the SQL Server CE Database Security Features ● Reorganizes a table's pages so they reside in adjacent database pages. This improves performance by reducing
table fragmentation across the database.

Maintaining SQL Server CE Databases ●


Reorders table rows when there is a UNIQUE or PRIMARY KEY constraint present on the table.
Reclaims unused space created by object and record deletions by rewriting all database data into new data pages
with no gaps in the page. When objects or records are deleted from the database, the space they occupied is
marked as available for new additions to the database. However, unless an entire page of data has been deleted,
the page remains in a partially filled state and the size of the database does not shrink until either the final data is
deleted from the page or the database is compacted. For databases in which objects and records are frequently
added, deleted, and updated, you should compact frequently.
● Resets incrementing identity columns so the next value allocated will be one more than the highest value in the
remaining records. For example, if all records in the database have been deleted, compacting the database sets the
value of the identity column of the next record to 1. If the highest remaining identity value in the database is 50,
compacting the database sets the value of the next record to 51. Note that this is true even if records containing
values greater than 50 were added previously but were deleted prior to compacting.
● Regenerates the table statistics used in the query optimization process. These statistics can become out-of-date
when much time has elapsed, when transactions are rolled back, and when the database was not properly closed
due to power loss or failure to completely exit the program before turning the computer off.
● Repairs a suspect database.
● Modifies database properties.

Before compacting a database, ensure that the following conditions are met:

● The database must not be open.


● The source and destination database path must be different.

The destination database must not exist when CompactDatabase is called. An error occurs if the database
specified by DestConnection already exists or another file with that name already exists.

● Sufficient storage space must exist for both the original and compacted versions of the database, as well as any
cached data and data stored in the temporary database.

When a database is compacted, the following database properties can be modified:

● Password
● Whether or not the database is encrypted
● Locale identifier

See Also

CompactDatabase Method

ISSCECompact

Using SQL Server CE Query Analyzer

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_maintaining_your_database.asp [22/07/2004 07:16:57 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Accessing SQL Server CE Databases

The Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) database engine
provides the following features for accessing SQL Server CE databases:

Up One Level ● Parameterized queries

Using Parameters in Queries


Create queries with parameters and use these queries many times. The parameters are placeholders for values
Working with Cursors supplied at run time. For more information, see Using Parameters in Queries.

Using Transactions ● Intrinsic functions

Use mathematical, string, and system functions in your queries to perform operations and return scalar values. For
more information, see Functions.

● UNION operator

Obtain a single result set from a combination of two or more SELECT statements. For more information, see
UNION.

● SQL Server CE Query Analyzer

Use the SQL syntax in the SQL Server CE Query Analyzer to access and modify databases. For more information,
see Using SQL Server CE Query Analyzer.

For information about the SQL grammar, see SQL Reference for SQL Server CE. For more
information about Transact-SQL, see SQL Server Books Online in the MSDN® Library at this
Microsoft Web site.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li...e_creating_and_accessing_a_sql_server_ce_database.asp [22/07/2004 07:20:16 p.m.]


Using Parameters in Queries (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Accessing SQL Server CE Databases

SQL Server CE Books Online


Using Parameters in Queries

Parameters are often used when querying relational databases. Using parameters in queries allows the database client to run an SQL statement multiple
times with potentially different sets of values. This allows queries with the same structure and with only differing variables to be run without having to
recompile the query multiple times. This improved efficiency can be used to minimize query execution time, especially for large queries or queries that are
run many times.

In Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE), input parameters in a query are specified with parameter markers. A parameter
marker is a question mark (?) placed in the location of an input expression in an SQL statement. Values for the parameters are passed programmatically
when the command is executed.

Named parameters are not supported in SQL Server CE. Parameters can be used to replace only column values. They cannot be used in queries to replace
other objects, such as table or column names. The number and order in which you programmatically specify parameters must correspond to the
parameter markers in the query.

The .NET Compact Framework Data Provider for SQL Server CE supports use of parameters in queries. For more information about the
System.Data.SqlServerCe.SqlCeParameter and System.Data.SqlServerCe.SqlCeParameterCollection classes, see the .NET Compact Framework
SDK in Microsoft Visual Studio® .NET.

The OLE DB Provider for SQL Server CE also supports using parameters in queries. For more information, see Parameters.

Examples

A. Using parameters in an SQL query

In the following simple statement using the Northwind sample database, the requested value for CustomerID is passed programmatically when the
SELECT statement is executed.

SELECT * FROM Orders WHERE CustomerID =?

B. Using parameters to an insert a new row

In the following example, an SQL INSERT statement uses parameters to insert a new row into the Employees table of the Northwind sample database.

INSERT INTO Employees(LastName, FirstName, Title, TitleOfCourtesy,


BirthDate, HireDate, Address, City, Region, PostalCode, Country,
HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath, rowguid)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_using_parameters_in_queries_533.asp?frame=true [22/07/2004 07:20:24 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Accessing SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Using Parameters in Queries

Parameters are often used when querying relational databases. Using parameters in queries
allows the database client to run an SQL statement multiple times with potentially different
sets of values. This allows queries with the same structure and with only differing variables
to be run without having to recompile the query multiple times. This improved efficiency can
Up One Level be used to minimize query execution time, especially for large queries or queries that are
run many times.
Using Parameters in Queries
Working with Cursors In Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE), input parameters
in a query are specified with parameter markers. A parameter marker is a question mark (?)
Using Transactions placed in the location of an input expression in an SQL statement. Values for the
parameters are passed programmatically when the command is executed.

Named parameters are not supported in SQL Server CE. Parameters can be used to replace
only column values. They cannot be used in queries to replace other objects, such as table
or column names. The number and order in which you programmatically specify parameters
must correspond to the parameter markers in the query.

The .NET Compact Framework Data Provider for SQL Server CE supports use of parameters
in queries. For more information about the System.Data.SqlServerCe.SqlCeParameter
and System.Data.SqlServerCe.SqlCeParameterCollection classes, see the .NET
Compact Framework SDK in Microsoft Visual Studio® .NET.

The OLE DB Provider for SQL Server CE also supports using parameters in queries. For more
information, see Parameters.

Examples

A. Using parameters in an SQL query

In the following simple statement using the Northwind sample database, the requested
value for CustomerID is passed programmatically when the SELECT statement is executed.

SELECT * FROM Orders WHERE CustomerID =?

B. Using parameters to an insert a new row

In the following example, an SQL INSERT statement uses parameters to insert a new row
into the Employees table of the Northwind sample database.

INSERT INTO Employees(LastName, FirstName, Title, TitleOfCourtesy,


BirthDate, HireDate, Address, City, Region, PostalCode, Country,
HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath, rowguid)

http://msdn.microsoft.com/library/default.asp?url...qlce/htm/_lce_using_parameters_in_queries_533.asp (1 of 2) [22/07/2004 07:20:26 p.m.]


Welcome to the MSDN Library

VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url...qlce/htm/_lce_using_parameters_in_queries_533.asp (2 of 2) [22/07/2004 07:20:26 p.m.]


Working with Cursors (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Accessing SQL Server CE Databases

SQL Server CE Books Online


Working with Cursors

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports three types of cursors: base table, scrollable query, and forward-only.
Each cursor type is different. Carefully choose your cursor in order for your application to work most effectively.

Base Table Cursors

Base table cursors are the lowest-level cursor available and are the only updatable cursors. These cursors work directly against the storage engine and are
the fastest of all supported cursor types. These cursors support the ability to use bookmarks to position on rows. Indexes are supported to order the rows
in a table, to enable seeking on particular values, and to restrict the rows based on a range of values within an index. Base table cursors can scroll forward
or backward with minimal cost.

Base table cursors have dynamic membership, which means two cursors opened over the same table will immediately see insertions, deletions, and
changes to the data (assuming both are in the same transaction scope). Because base table cursors are updatable, a client can use this cursor type to
make changes to the underlying data.

Base table cursors cannot represent the results of a query. Instead, they reflect all the functionality available to a single table in the database engine.
Results of queries, such as SELECT * FROM tablename, are returned through one of the supported query result cursors.

To open a base table cursor in Microsoft ActiveX® Data Objects for Windows CE 3.1 (ADOCE), pass the adCmdTableDirect flag when the Recordset
object is opened. If this flag is not passed, the cursor cannot be a base table cursor because ADOCE implicitly prepends SELECT * FROM to the table
name. Base table cursors used in ADOCE and SQL Server CE should use adOpenDynamic and adLockOptimistic, for example:

rs.Open "tablename", cn, adOpenDynamic, adLockOptimistic, adCmdTableDirect

Scrollable Query Cursors

Scrollable query cursors are the most functional query-result cursors. These cursors support scrolling backward and forward and using bookmarks to
position on rows. They do not support updates or indexes. Scrollable cursors do not see external changes to the data; the results of the query are cached
for the lifetime of the cursor. Although scrollable cursors are more functional than forward-only cursors, scrollable cursors are slower and use more
memory. Clients should use scrollable cursors only if scrolling or bookmarking is necessary. SQL Server CE does not support updatable cursors from the
query processor.

Scrollable cursors can use either adOpenStatic or adOpenKeyset. These cursors should use adLockReadOnly and not specify the adCmdTableDirect
flag, for example:

rs.Open "SELECT * FROM tablename WHERE col1 > 2;", cn, adOpenStatic, adLockReadOnly

Forward-only Cursors

Forward-only cursors are only returned by the query processor and are the fastest query-based cursor. These cursors do not support bookmarks, scrolling
backward, indexes, or updating. These cursors should be used in scenarios in which speed and memory footprint are most important and query results are
required. Restarting these cursors is relatively expensive because the query must be run again.

Forward-only cursors should use adOpenForwardOnly and adLockOptimistic, and the adCmdTableDirect flag should not be used, for example:

rs.Open "SELECT * FROM tablename WHERE col1 > 2;", cn, adOpenForwardOnly, adLockOptimistic

See Also

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_cursor_types.asp?frame=true (1 of 2) [22/07/2004 07:20:32 p.m.]


Working with Cursors (SQL Server CE Books Online)

Cursors

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_cursor_types.asp?frame=true (2 of 2) [22/07/2004 07:20:32 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Accessing SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Working with Cursors

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports three types of
cursors: base table, scrollable query, and forward-only. Each cursor type is different. Carefully
choose your cursor in order for your application to work most effectively.

Up One Level
Using Parameters in Queries Base Table Cursors
Working with Cursors
Using Transactions Base table cursors are the lowest-level cursor available and are the only updatable cursors. These
cursors work directly against the storage engine and are the fastest of all supported cursor types.
These cursors support the ability to use bookmarks to position on rows. Indexes are supported to
order the rows in a table, to enable seeking on particular values, and to restrict the rows based on
a range of values within an index. Base table cursors can scroll forward or backward with minimal
cost.

Base table cursors have dynamic membership, which means two cursors opened over the same
table will immediately see insertions, deletions, and changes to the data (assuming both are in the
same transaction scope). Because base table cursors are updatable, a client can use this cursor
type to make changes to the underlying data.

Base table cursors cannot represent the results of a query. Instead, they reflect all the functionality
available to a single table in the database engine. Results of queries, such as SELECT * FROM
tablename, are returned through one of the supported query result cursors.

To open a base table cursor in Microsoft ActiveX® Data Objects for Windows CE 3.1 (ADOCE), pass
the adCmdTableDirect flag when the Recordset object is opened. If this flag is not passed, the
cursor cannot be a base table cursor because ADOCE implicitly prepends SELECT * FROM to the
table name. Base table cursors used in ADOCE and SQL Server CE should use adOpenDynamic
and adLockOptimistic, for example:

rs.Open "tablename", cn, adOpenDynamic, adLockOptimistic, adCmdTableDirect

Scrollable Query Cursors

Scrollable query cursors are the most functional query-result cursors. These cursors support
scrolling backward and forward and using bookmarks to position on rows. They do not support
updates or indexes. Scrollable cursors do not see external changes to the data; the results of the
query are cached for the lifetime of the cursor. Although scrollable cursors are more functional than
forward-only cursors, scrollable cursors are slower and use more memory. Clients should use
scrollable cursors only if scrolling or bookmarking is necessary. SQL Server CE does not support
updatable cursors from the query processor.

Scrollable cursors can use either adOpenStatic or adOpenKeyset. These cursors should use
adLockReadOnly and not specify the adCmdTableDirect flag, for example:

rs.Open "SELECT * FROM tablename WHERE col1 > 2;", cn, adOpenStatic, adLockReadOnly

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_cursor_types.asp (1 of 2) [22/07/2004 07:20:35 p.m.]


Welcome to the MSDN Library

Forward-only Cursors

Forward-only cursors are only returned by the query processor and are the fastest query-based
cursor. These cursors do not support bookmarks, scrolling backward, indexes, or updating. These
cursors should be used in scenarios in which speed and memory footprint are most important and
query results are required. Restarting these cursors is relatively expensive because the query must
be run again.

Forward-only cursors should use adOpenForwardOnly and adLockOptimistic, and the


adCmdTableDirect flag should not be used, for example:

rs.Open "SELECT * FROM tablename WHERE col1 > 2;", cn, adOpenForwardOnly, adLockOptimistic

See Also

Cursors

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_cursor_types.asp (2 of 2) [22/07/2004 07:20:35 p.m.]


Using Transactions (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Accessing SQL Server CE Databases

SQL Server CE Books Online


Using Transactions

Transactions provide a mechanism to group a series of changes to a database in one atomic operation. After changes have been made to the database,
these changes can be committed or canceled. Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports transactions and exposes
the ability to use them directly through both Microsoft ActiveX® Data Objects for Windows CE 3.1 (ADOCE) and the OLE DB layer. Transactions can also
be nested. Within a larger transaction, it is possible to have atomic units of work that are individually committed or canceled.

The SQL Server CE transaction model differs from that of Microsoft SQL Server. When you develop applications to run on both, it is important to keep the
following information in mind:

● SQL Server CE supports only single-phase commit transactions.


● In SQL Server CE, transactions can be nested up to five levels deep.
● The transaction isolation model exposed in SQL Server CE is "Read Committed," which means SQL Server CE can isolate users from uncommitted changes in a database.
● SQL Server CE holds an exclusive lock on a table that has been altered in a transaction until that transaction completes. Additional attempts to open the table or perform modifications on it will fail until the
lock in the transaction is released. Consequently, it is not generally recommended that DDL operations be performed inside transactions because of the potential for locking conflicts to occur.
● Transactions also influence the way cursors function. In SQL Server CE, if a cursor is opened within a transaction, the cursor exists within the scope of that transaction. If the transaction is canceled, the
cursor ceases to exist. To continue using a cursor after a canceled transaction, the cursor should be created outside the scope of the transaction. Within the context of ADOCE and OLE DB for SQL Server
CE, this means that the recordset would become a zombie and must be closed. If the transaction commits, the cursor still exists and is fully functional.

For more information about using transactions with the OLE DB Provider for SQL Server CE, see Transactions.

Examples

The following Microsoft Visual Basic® example shows the use of transactions using ADOCE.

Sub TransactionExample()
Dim cn As ADOCE.Connection
Dim rs As ADOCE.Recordset
Set cn = CreateObject("ADOCE.Connection.3.1")
Set rs = CreateObject("ADOCE.Recordset.3.1")

'Open a connection to a SQL Server CE database.


cn.Open "provider=Microsoft.SQLServer.OLEDB.CE.2.0;data source=\ssce.sdf;"

' Begin a transaction.


cn.BeginTrans
' Commit that transaction.
cn.CommitTrans

' Demonstrate that opening a table outside of the transaction


' avoids potential problems with DBPROP_ABORTPRESERVE.
rs.Open "helloworld", cn, adOpenDynamic, adLockOptimistic
cn.BeginTrans
cn.RollbackTrans
rs.MoveFirst ' recordset is still functional
rs.Close

' Opening a rowset within a transaction that is canceled


' will zombie the rowset. This can be accessed in ADOCE
' through the "Preserve on Abort" property.
cn.BeginTrans
rs.Open "helloworld", cn, adOpenDynamic, adLockOptimistic
Debug.Print rs.Properties("Preserve on Abort")
Debug.Print rs.State
cn.RollbackTrans
rs.MoveFirst
End Sub

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_transactions.asp?frame=true [22/07/2004 07:20:42 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Accessing SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Using Transactions

Transactions provide a mechanism to group a series of changes to a database in one atomic


operation. After changes have been made to the database, these changes can be committed
or canceled. Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports
transactions and exposes the ability to use them directly through both Microsoft ActiveX®
Up One Level Data Objects for Windows CE 3.1 (ADOCE) and the OLE DB layer. Transactions can also be
nested. Within a larger transaction, it is possible to have atomic units of work that are
Using Parameters in Queries individually committed or canceled.

Working with Cursors


The SQL Server CE transaction model differs from that of Microsoft SQL Server. When you
Using Transactions develop applications to run on both, it is important to keep the following information in
mind:

● SQL Server CE supports only single-phase commit transactions.


● In SQL Server CE, transactions can be nested up to five levels deep.
● The transaction isolation model exposed in SQL Server CE is "Read Committed," which means SQL Server CE can
isolate users from uncommitted changes in a database.
● SQL Server CE holds an exclusive lock on a table that has been altered in a transaction until that transaction
completes. Additional attempts to open the table or perform modifications on it will fail until the lock in the
transaction is released. Consequently, it is not generally recommended that DDL operations be performed inside
transactions because of the potential for locking conflicts to occur.
● Transactions also influence the way cursors function. In SQL Server CE, if a cursor is opened within a transaction,
the cursor exists within the scope of that transaction. If the transaction is canceled, the cursor ceases to exist. To
continue using a cursor after a canceled transaction, the cursor should be created outside the scope of the
transaction. Within the context of ADOCE and OLE DB for SQL Server CE, this means that the recordset would
become a zombie and must be closed. If the transaction commits, the cursor still exists and is fully functional.

For more information about using transactions with the OLE DB Provider for SQL Server CE,
see Transactions.

Examples

The following Microsoft Visual Basic® example shows the use of transactions using ADOCE.

Sub TransactionExample()
Dim cn As ADOCE.Connection
Dim rs As ADOCE.Recordset
Set cn = CreateObject("ADOCE.Connection.3.1")
Set rs = CreateObject("ADOCE.Recordset.3.1")

'Open a connection to a SQL Server CE database.


cn.Open "provider=Microsoft.SQLServer.OLEDB.CE.2.0;data source=\ssce.sdf;"

' Begin a transaction.


cn.BeginTrans
' Commit that transaction.
cn.CommitTrans

' Demonstrate that opening a table outside of the transaction


' avoids potential problems with DBPROP_ABORTPRESERVE.
rs.Open "helloworld", cn, adOpenDynamic, adLockOptimistic
cn.BeginTrans
cn.RollbackTrans
rs.MoveFirst ' recordset is still functional
rs.Close

' Opening a rowset within a transaction that is canceled

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_transactions.asp (1 of 2) [22/07/2004 07:20:44 p.m.]


Welcome to the MSDN Library

' will zombie the rowset. This can be accessed in ADOCE


' through the "Preserve on Abort" property.
cn.BeginTrans
rs.Open "helloworld", cn, adOpenDynamic, adLockOptimistic
Debug.Print rs.Properties("Preserve on Abort")
Debug.Print rs.State
cn.RollbackTrans
rs.MoveFirst
End Sub

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_transactions.asp (2 of 2) [22/07/2004 07:20:44 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases
Advanced Search

SQL Server CE Books Online


Using SQL Server CE Query Analyzer

SQL Server CE Query Analyzer is a graphical tool included in Microsoft® SQL Server™ 2000
Windows® CE Edition (SQL Server CE) that you can use to:

Up One Level ● Create databases.


● Manage and connect to other databases on a device.

Navigating the Query Window ●


Verify remote data access (RDA) and replication applications.
Create and modify tables and indexes in a database.
Query objects by using the SELECT statement.
Managing Databases and Database Connections in the Objects Tab

● Insert and delete rows in a table.


● Modify existing data in a table.
Compact and repair a database.
Managing Database Objects in the Objects Tab

Executing SQL Statements in the SQL Tab Note To navigate the graphical interface and execute
commands in SQL Server CE Query Analyzer on a device,
you must use a stylus. However, when the device is
connected to a desktop computer, the desktop keyboard
and mouse can be used in conjunction with Microsoft
Remote Display Control for Windows CE.

Queries that are executed through SQL Server CE Query Analyzer run with the following
default behavior, which cannot be changed:

● QUOTED_IDENTIFIER_ON
● ANSI_NULLS_ON
● ANSI_PADDING_ON
● ANSI_NULL_DFLT_ON_ON
● CONCAT_NULL_YIELDS_NULL_ON

Installing and Starting SQL Server CE Query Analyzer

The installation of SQL Server CE Query Analyzer depends on the development environment
onto which SQL Server CE is installed. When you install SQL Server CE, SQL Server CE
Query Analyzer is not installed by default on a device. For more information, see Installing
SQL Server CE Query Analyzer.

To start SQL Server CE Query Analyzer

● Run the SQL Server CE Query Analyzer executable file, Isqlw20.exe, directly from the Start menu or from the
directory in which it is installed.

After SQL Server CE Query Analyzer is installed, you can refer to the following topics that
describe how to use it:

● Navigating the Query Window


● Managing Databases and Database Connections in the Objects Tab
● Managing Database Objects in the Objects Tab
● Executing SQL Statements in the SQL Tab

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../sqlce/htm/_lce_using_sql_server_ce_query_analyzer.asp [22/07/2004 07:28:35 p.m.]


Navigating the Query Window (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer

SQL Server CE Books Online


Navigating the Query Window

When you start SQL Server CE Query Analyzer, the query window contains the following tabs: Objects, SQL, Grid, and Notes.

Objects tab
Use the Objects tab to manage databases and database connections, and explore, add, and drop database objects. When you connect to a
database, you can view, add, and drop:
● Tables
● Table columns
● Indexes
● System tables (view only)

To perform these functions, use the buttons located either at the bottom of the screen on a Pocket PC device, or the top of the screen on a
Handheld PC device. The availability of the buttons depends on the node that is selected in the database tree. For example, when you select a
table, buttons are available for executing a SELECT * FROM table_name statement, adding a column to the table, creating an index on the
table, and dropping the table. The following illustration shows SQL Server CE Query Analyzer as it appears on a Pocket PC device.

A. Tap to execute a SELECT * FROM Employees statement.


B. Tap to add a column to the Employees table.
C. Tap to create an index on the Employees table.
D. Tap to drop the Employees table.
SQL tab
Is a command-line editor, which you can use to:
● Type and execute SQL statements.
● Manage SQL Server CE script files.
● Save SQL statements directly in SQL Server CE Query Analyzer for editing and reuse.
Grid tab
Shows the results set of a query.
Notes tab

http://msdn.microsoft.com/library/en-us/sqlce/ht...e_navigating_the_query_window_705.asp?frame=true (1 of 2) [22/07/2004 07:31:52 p.m.]


Navigating the Query Window (SQL Server CE Books Online)

Displays messages after a command has been executed from either the Objects tab or the SQL tab. If a query executes successfully, a
message provides information about the elapsed time and rows affected, if any. If a command results in an error or a query itself contains an
error or unsupported SQL elements, a message provides error information, which includes the failed query and a short description.

The Notes tab contains a Copy button for selecting text and pasting to the SQL tab or a text editor. For information about errors, see SQL
Server CE Errors.

The Tools Menu

The Tools menu is available in all four panes and contains the following items:

Refresh
Refreshes the view of the database tree in the Objects tab after any changes are made to the database.
Logging
When selected, logs corresponding SQL statements in the SQL tab when commands are executed in the Objects tab. Logged statements are
not saved automatically. To save logged statements, see "Managing SQL Scripts" in Executing SQL Statements in the SQL Tab.
Fonts...
Changes the font settings of text in all four tabs.
About...
Provides version information about SQL Server CE and SQL Server CE Query Analyzer.
Exit
Exits SQL Server CE Query Analyzer.

Note If you exit SQL Server CE Query Analyzer without closing a database connection, when you restart SQL Server CE Query Analyzer, the
Objects tab shows the last database connection and the last view.

The SQL Menu

The SQL menu is available only in the SQL tab. For more information about the SQL menu, see Executing SQL Statements in the SQL Tab.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/ht...e_navigating_the_query_window_705.asp?frame=true (2 of 2) [22/07/2004 07:31:52 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer
Advanced Search

SQL Server CE Books Online


Navigating the Query Window

When you start SQL Server CE Query Analyzer, the query window contains the following
tabs: Objects, SQL, Grid, and Notes.

Up One Level Objects tab


Use the Objects tab to manage databases and database connections, and
Navigating the Query Window explore, add, and drop database objects. When you connect to a database, you
can view, add, and drop:
Managing Databases and Database Connections in the Objects Tab ● Tables
Table columns

Managing Database Objects in the Objects Tab


● Indexes
● System tables (view only)

Executing SQL Statements in the SQL Tab


To perform these functions, use the buttons located either at the bottom of the
screen on a Pocket PC device, or the top of the screen on a Handheld PC device.
The availability of the buttons depends on the node that is selected in the
database tree. For example, when you select a table, buttons are available for
executing a SELECT * FROM table_name statement, adding a column to the
table, creating an index on the table, and dropping the table. The following
illustration shows SQL Server CE Query Analyzer as it appears on a Pocket PC
device.

A. Tap to execute a SELECT * FROM Employees statement.


B. Tap to add a column to the Employees table.
C. Tap to create an index on the Employees table.
D. Tap to drop the Employees table.
SQL tab
Is a command-line editor, which you can use to:
● Type and execute SQL statements.
● Manage SQL Server CE script files.
● Save SQL statements directly in SQL Server CE Query Analyzer for editing and reuse.
Grid tab
Shows the results set of a query.
Notes tab
Displays messages after a command has been executed from either the Objects
tab or the SQL tab. If a query executes successfully, a message provides
information about the elapsed time and rows affected, if any. If a command
results in an error or a query itself contains an error or unsupported SQL
elements, a message provides error information, which includes the failed query
and a short description.

The Notes tab contains a Copy button for selecting text and pasting to the SQL
tab or a text editor. For information about errors, see SQL Server CE Errors.

http://msdn.microsoft.com/library/default.asp?url...qlce/htm/_lce_navigating_the_query_window_705.asp (1 of 2) [22/07/2004 07:32:11 p.m.]


Welcome to the MSDN Library

The Tools Menu

The Tools menu is available in all four panes and contains the following items:

Refresh
Refreshes the view of the database tree in the Objects tab after any changes
are made to the database.
Logging
When selected, logs corresponding SQL statements in the SQL tab when
commands are executed in the Objects tab. Logged statements are not saved
automatically. To save logged statements, see "Managing SQL Scripts" in
Executing SQL Statements in the SQL Tab.
Fonts...
Changes the font settings of text in all four tabs.
About...
Provides version information about SQL Server CE and SQL Server CE Query
Analyzer.
Exit
Exits SQL Server CE Query Analyzer.

Note If you exit SQL Server CE Query Analyzer without closing a database
connection, when you restart SQL Server CE Query Analyzer, the Objects tab
shows the last database connection and the last view.

The SQL Menu

The SQL menu is available only in the SQL tab. For more information about the SQL menu,
see Executing SQL Statements in the SQL Tab.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url...qlce/htm/_lce_navigating_the_query_window_705.asp (2 of 2) [22/07/2004 07:32:11 p.m.]


Managing Databases and Database Connections in the Objects Tab (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer

SQL Server CE Books Online


Managing Databases and Database Connections in the Objects Tab

You must connect to a database before you can view, add, or drop database objects in the Objects tab; or before you can execute queries against a database in the
SQL tab. Use the Objects tab to manage database connections. If you are connecting to a database for the first time, it is added to the list of managed databases in the
Databases folder. If you are connecting to a database that was connected to previously, the database is listed under the Databases folder.

To connect to a database for the first time

1. In the Objects tab, select the Databases folder.


2. Tap the database connection button. The button must show a green arrow. If the button shows a red square, you are already connected to a database. Tap the button to disconnect. Microsoft® SQL Server™ 2000 Windows®
CE Edition (SQL Server CE) allows only one database connection at a time.

Indicates no current connection to the database. Tap to connect.

Indicates an established connection to the database. Tap to disconnect.

3. In the Connect to SQL Server CE dialog box, enter the path for the database or tab the browse (...) button to select a database.

Note On a Handheld PC device, you can browse to the root directory to locate a database. On a Pocket PC device, you can browse to
the My Documents folder. To locate databases at the root directory, which includes any sample databases, type a backslash (\) in
front of the database name. For example, to connect to Northwind.sdf, type \Northwind.sdf.

4. If the database is password protected, enter a password.


5. Tap Connect.

To connect to a database that was connected to previously

● In the Objects tab, expand the Databases folder, select the database, and then tap the database connection button.

Note If a database connection is underway when you try to connect to another database, SQL Server CE drops the current
connection and starts a new connection as part of the same operation.

If you exit SQL Server CE Query Analyzer without closing a database connection, when you restart SQL Server CE Query Analyzer, the Objects tab shows
the last database connection and the last view.

To disconnect from the current database

● In the Objects tab, select either the Databases folder or the database you want to disconnect from, and then tap the database connection button. Before you tap, the button displays a red square. If the button displays a
green arrow, you are already disconnected.

To remove a single database from the list of managed databases in the Databases folder

1. Select the database you want to remove. If you are connected to the database, you must disconnect.
2. Tap the database management button. In the message window that appears, tap OK.

Tap to stop managing the database.

To remove all databases from the list of managed databases in the Databases folder

1. Disconnect from the current database, if necessary.


2. Select the Databases folder, and then tap the database management button.

To compact and repair a database

1. Disconnect from the current database, if necessary.


2. Select the database you want to compact and repair, and then tap the compact and repair button.

Tap to compact and repair the database.

For information about compacting and repairing a database, see Maintaining SQL Server CE Databases.

http://msdn.microsoft.com/library/en-us/sqlce/ht...tabases_and_database_connecti_533.asp?frame=true (1 of 2) [22/07/2004 07:32:23 p.m.]


Managing Databases and Database Connections in the Objects Tab (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/ht...tabases_and_database_connecti_533.asp?frame=true (2 of 2) [22/07/2004 07:32:23 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer
MSDN Library Go
Advanced Search SQL Server CE Books Online
Managing Databases and Database Connections in the Objects Tab

You must connect to a database before you can view, add, or drop database objects in the Objects tab; or before you can execute queries against a database in the
SQL tab. Use the Objects tab to manage database connections. If you are connecting to a database for the first time, it is added to the list of managed databases in the
Databases folder. If you are connecting to a database that was connected to previously, the database is listed under the Databases folder.

To connect to a database for the first time


Up One Level
Navigating the Query Window 1. In the Objects tab, select the Databases folder.

Managing Databases and Database Connections in the Objects Tab


2. Tap the database connection button. The button must show a green arrow. If the button shows a red square, you are already connected to a database. Tap the button to disconnect. Microsoft® SQL Server™ 2000 Windows®
CE Edition (SQL Server CE) allows only one database connection at a time.

Managing Database Objects in the Objects Tab Indicates no current connection to the database. Tap to connect.

Executing SQL Statements in the SQL Tab


Indicates an established connection to the database. Tap to disconnect.

3. In the Connect to SQL Server CE dialog box, enter the path for the database or tab the browse (...) button to select a database.

Note On a Handheld PC device, you can browse to the root directory to locate a database. On a Pocket PC device, you can browse to
the My Documents folder. To locate databases at the root directory, which includes any sample databases, type a backslash (\) in
front of the database name. For example, to connect to Northwind.sdf, type \Northwind.sdf.

4. If the database is password protected, enter a password.


5. Tap Connect.

To connect to a database that was connected to previously

● In the Objects tab, expand the Databases folder, select the database, and then tap the database connection button.

Note If a database connection is underway when you try to connect to another database, SQL Server CE drops the current
connection and starts a new connection as part of the same operation.

If you exit SQL Server CE Query Analyzer without closing a database connection, when you restart SQL Server CE Query Analyzer, the Objects tab shows
the last database connection and the last view.

To disconnect from the current database

● In the Objects tab, select either the Databases folder or the database you want to disconnect from, and then tap the database connection button. Before you tap, the button displays a red square. If the button displays a
green arrow, you are already disconnected.

To remove a single database from the list of managed databases in the Databases folder

1. Select the database you want to remove. If you are connected to the database, you must disconnect.
2. Tap the database management button. In the message window that appears, tap OK.

Tap to stop managing the database.

To remove all databases from the list of managed databases in the Databases folder

1. Disconnect from the current database, if necessary.


2. Select the Databases folder, and then tap the database management button.

To compact and repair a database

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_managing_databases_and_database_connecti_533.asp (1 of 2) [22/07/2004 07:32:51 p.m.]


Welcome to the MSDN Library
1. Disconnect from the current database, if necessary.
2. Select the database you want to compact and repair, and then tap the compact and repair button.

Tap to compact and repair the database.

For information about compacting and repairing a database, see Maintaining SQL Server CE Databases.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_managing_databases_and_database_connecti_533.asp (2 of 2) [22/07/2004 07:32:51 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer
MSDN Library Go
Advanced Search SQL Server CE Books Online
Managing Database Objects in the Objects Tab

In the Objects tab, you can add and drop databases, tables, and indexes; and define many of the most common properties of tables and indexes when you create
them. For more specific table and index definition requirements, however, you must execute an SQL statement in the SQL tab.

To create a database

Up One Level
Viewing and Modifying Index Properties 1. In the Objects tab, select the Databases folder, and then tap the database connection button. The button must show a green arrow. If the button shows a red square, you are already connected to a database. Tap the button
to disconnect. Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) allows only one database connection at a time.
2. In the Connect to SQL Server CE dialog box, enter the path and name of the database, and then tap New Database.
3. In the Password box, enter a password if you want the database to be password-protected. In the Sort box, select a database collation. The default collation, General, corresponds to Latin1_general. To encrypt the
database, select Encrypt.

Note Encryption must be used in conjunction with a password. Other conditions apply to implement encryption. For more information
about passwords and encryption in SQL Server CE, see Using the SQL Server CE Database Security Features.

4. Tap Create.

To create a table

1. In the Objects tab, select either the database to which you are connected or the Tables folder of the database connection, and then tap the create table button.

Tap to create a table.

2. In the Table Definition dialog box, enter a name for the table, and then tap Insert Column.
3. In the Column Definition dialog box, specify the properties of a column. The properties include: column name, data type, length (if applicable), nullability, precision, scale, and identity. You can also define a UNIQUE or
PRIMARY KEY constraint and a default value for the column.

Note When you create a table with a UNIQUE or PRIMARY KEY constraint, SQL Server CE automatically creates a unique index on
that table. For more information, see Viewing and Modifying Index Properties.

For information about the data types that SQL Server CE supports, see Data Types.

4. To return to the Table Definition dialog box, tap OK. Either repeat the process for additional columns, or tap OK to finish.

To add a column to a table

1. In the Objects tab, connect to a database, and expand the Tables folder.
2. Expand the table you want to add a column to, select the Columns folder, and then tap the add column definition button.

Tap to add a column to a table.

3. In the Column Definition dialog box, specify the properties of a column. The properties include: column name, data type, length (if applicable), nullability, precision, scale, and identity. You can also define a UNIQUE or
PRIMARY KEY constraint and a default value for the column. To create the column, tap OK.

Note When you create a table with a UNIQUE or PRIMARY KEY constraint, SQL Server CE automatically creates a unique index on
that table. For more information, see Viewing and Modifying Index Properties.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_managing_database_objects_using_the_obje_705.asp (1 of 2) [22/07/2004 07:33:12 p.m.]


Welcome to the MSDN Library

For information about the data types that SQL Server CE supports, see Data Types.

To execute a SELECT * FROM table_name statement

1. In the Objects tab, connect to a database, expand the Table folder, and then select a table.
2. Tap the execute button. The results of the SELECT * FROM table_name statement appear in the Grid tab, and the messages appear in the Notes tab.

Tab to execute a SELECT * FROM table_name statement.

To show/hide system tables

● In the Objects tab, connect to a database, select the Tables folder, and then tap the system table button.

Tap to view system tables.

Tap to hide system tables.

To create an index

1. In the Objects tab, connect to a database, and then expand the Tables folder.
2. In the Tables folder, select the table you want to index (or expand that table and select the Indexes folder), and then tap the create index button.

Tab to create an index.

3. In the Index Definition dialog box, enter a name for the index. If the index is unique, select Unique.
4. In the Columns list box, select the column(s) you want to base the index on. If you want the index sorted on that column in ascending order, tap A->. If you want the index sorted on that column in descending order, tap D-
>. To remove a column from the list of index keys, select the column and tap <-.
5. Tap OK.

Note When you create a table with a UNIQUE or PRIMARY KEY constraint, SQL Server CE automatically creates a unique index on
that table. For more information, see Viewing and Modifying Index Properties.

For information about how to view and modify index properties, see Viewing and Modifying Index Properties.

To delete databases and database objects

● To delete databases and database objects in the Objects tab, select the object you want to delete, and then tap the delete button. For example, if you want to drop the Territories table from the Northwind sample
database, select Territories and tap the delete button. If you only want to drop the TerritoryDescription column of the Territories table, select TerritoryDescription and tap the delete button. In both cases, a warning
message appears asking whether you are sure you want to drop the object.

Tap to delete a database object.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_managing_database_objects_using_the_obje_705.asp (2 of 2) [22/07/2004 07:33:12 p.m.]


Viewing and Modifying Index Properties (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer > Managing Database Objects in the
Objects Tab

SQL Server CE Books Online

Viewing and Modifying Index Properties


By expanding the Indexes folder of a table, you can view all the indexes of a table, including any unique indexes, as shown in the following illustration.
(The illustrations in this topic show SQL Server CE Query Analyzer as it appears on a Pocket PC device.)

A. Indexes on the Order Details table.


B. Tap to create a new index on the Order Details table.
C. Unique index.

By expanding an individual index, you can view the columns on which the index is built. The columns are listed in sort order (if the index is sorted on more
than one column). To change the order in which a column appears, select the column and tap either the MOVE DOWN or MOVE UP arrow (see the
following illustration).

You can also view whether a particular index column is sorted in ascending or descending order. The index column icon shows a downward pointing arrow
if it is sorted in descending order, and an upward pointing arrow if it is sorted in ascending order. To change whether a particular column is sorted in
ascending or descending order, select the column and tap the sort button (see the following illustration).

To remove a column from an index entirely, select the column and tap the delete icon (see the following illustration).

http://msdn.microsoft.com/library/en-us/sqlce/htm...and_modifying_index_properties_705.asp?frame=true (1 of 2) [22/07/2004 07:33:27 p.m.]


Viewing and Modifying Index Properties (SQL Server CE Books Online)

A. Columns on which the PK_Order_Details index is built.


B. Tap to change the sort order of the OrderID column to ascending.
C. Tap to move the OrderID column down in the sort order of the PK_Order_Details index.
D. Tap to move the ProductID column up in the sort order of the PK_Order_Details index. (ProductID must be selected first.)
E. Tap to drop the OrderID column from the PK_Order_Details index.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm...and_modifying_index_properties_705.asp?frame=true (2 of 2) [22/07/2004 07:33:27 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer > Managing Database
Advanced Search Objects in the Objects Tab

SQL Server CE Books Online

Viewing and Modifying Index


Properties
Up One Level
By expanding the Indexes folder of a table, you can view all the indexes of a table, including
Viewing and Modifying Index Properties any unique indexes, as shown in the following illustration. (The illustrations in this topic
show SQL Server CE Query Analyzer as it appears on a Pocket PC device.)

A. Indexes on the Order Details table.


B. Tap to create a new index on the Order Details table.
C. Unique index.

By expanding an individual index, you can view the columns on which the index is built. The
columns are listed in sort order (if the index is sorted on more than one column). To change
the order in which a column appears, select the column and tap either the MOVE DOWN or
MOVE UP arrow (see the following illustration).

http://msdn.microsoft.com/library/default.asp?url...ce_viewing_and_modifying_index_properties_705.asp (1 of 2) [22/07/2004 07:33:53 p.m.]


Welcome to the MSDN Library

You can also view whether a particular index column is sorted in ascending or descending
order. The index column icon shows a downward pointing arrow if it is sorted in descending
order, and an upward pointing arrow if it is sorted in ascending order. To change whether a
particular column is sorted in ascending or descending order, select the column and tap the
sort button (see the following illustration).

To remove a column from an index entirely, select the column and tap the delete icon (see
the following illustration).

A. Columns on which the PK_Order_Details index is built.


B. Tap to change the sort order of the OrderID column to ascending.
C. Tap to move the OrderID column down in the sort order of the PK_Order_Details
index.
D. Tap to move the ProductID column up in the sort order of the PK_Order_Details
index. (ProductID must be selected first.)
E. Tap to drop the OrderID column from the PK_Order_Details index.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url...ce_viewing_and_modifying_index_properties_705.asp (2 of 2) [22/07/2004 07:33:53 p.m.]


Executing SQL Statements in the SQL Tab (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer

SQL Server CE Books Online


Executing SQL Statements in the SQL Tab

When you use SQL Server CE Query Analyzer to execute SQL statements, the following conditions apply:

● You can execute queries comprised of one SQL statement, or multiple statements separated by a semicolon (;).
● If no text is selected when executing, Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) attempts to execute all text in the SQL tab as a single batch.
● You can perform text-editing tasks using the cut, copy, and paste buttons.
● On the SQL menu, when Word Wrap is selected, SQL statements wrap to fit on the screen of the SQL tab. When Word Wrap is not selected, SQL statements flow beyond the screen.

Tap to execute an SQL statement or batch.

Tap to cut text.

Tap to copy text.

Tap to paste text.

Managing SQL Scripts

In the SQL tab, you can create new script files for SQL Server CE, open existing ones, and save the files to a directory. You can also save frequently used SQL
statements directly in SQL Server CE Query Analyzer for editing and reuse. The following tasks are performed primarily by using the New, Open, and Save commands
on the SQL menu.

To start a new SQL Server CE script file

● On the SQL menu, tap New. This clears all text from the SQL tab to start a new script file.

To open a SQL Server CE script file

● To open the most recent SQL Server CE script files that were previously accessed, tap the Tools menu, and then tap the file you want to open.

Or

● On the SQL menu, tap Open, and in the Name list box, tap the script file you want to open. If the file you want to open does not appear in the Name list box, in the Folder box, select the directory of the file; and in the
Type box, specify the file type.

To save a SQL Server CE script file

● To save the current script file, on the SQL menu, tap Save. If the file already exists, the most recent version that appears in the SQL tab is saved in its current directory.

Or

● If the script file is new, in the Save As dialog box, enter the appropriate information in the Name, Folder, Type, and Location boxes.

Saving Frequently Used SQL Statements for Editing and Reuse

You can save up to 10 frequently used SQL statements directly in SQL Server CE Query Analyzer, and browse the text of each statement simultaneously to determine
which one you want to open for editing and reuse.

To save SQL statements

1. In the SQL tab, select the text you want to save, and then tap the preset button.

Tap to save an SQL statement.

2. In the Button Presets dialog box, tap the preset button number (1 through 10) you want the statement to correspond to. The first line of the statement appears next to the button number. If any SQL statements have been
added previously, the first line of their contents appears next to their assigned button numbers. If the button number corresponds to a previously added statement, the new statement overwrites it.
3. To save, tap OK.

http://msdn.microsoft.com/library/en-us/sqlce/htm..._sql_statements_in_the_sql_tab_533.asp?frame=true (1 of 2) [22/07/2004 07:34:48 p.m.]


Executing SQL Statements in the SQL Tab (SQL Server CE Books Online)

To open a saved statement

● In the SQL tab, tap the preset button number corresponding to the saved statement. If you are not sure which button number to choose, tap the preset button to view the list of saved statements, and then tap Cancel to
return to the SQL tab. The following illustration shows SQL Server CE Query Analyzer as it appears on a Pocket PC device.

A. Tap to open a saved SQL statement. (Tap the number corresponding to the preset button number the statement was saved under.)
B. Tap to view a list of saved SQL statements and their corresponding preset button numbers, or to save an SQL statement. (Text must be entered and selected to save an SQL statement.)

If you edit the SQL statement after opening it, the changes will not be reflected in the Button Presets dialog box. To save the changes, repeat the save process for saving a statement described previously.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm..._sql_statements_in_the_sql_tab_533.asp?frame=true (2 of 2) [22/07/2004 07:34:48 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Working with SQL Server CE Databases > Using SQL Server CE Query Analyzer
MSDN Library Go
Advanced Search SQL Server CE Books Online
Executing SQL Statements in the SQL Tab

When you use SQL Server CE Query Analyzer to execute SQL statements, the following conditions apply:

● You can execute queries comprised of one SQL statement, or multiple statements separated by a semicolon (;).
● If no text is selected when executing, Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) attempts to execute all text in the SQL tab as a single batch.
● You can perform text-editing tasks using the cut, copy, and paste buttons.
● On the SQL menu, when Word Wrap is selected, SQL statements wrap to fit on the screen of the SQL tab. When Word Wrap is not selected, SQL statements flow beyond the screen.

Up One Level
Tap to execute an SQL statement or batch.
Navigating the Query Window
Managing Databases and Database Connections in the Objects Tab Tap to cut text.

Managing Database Objects in the Objects Tab Tap to copy text.

Executing SQL Statements in the SQL Tab


Tap to paste text.

Managing SQL Scripts

In the SQL tab, you can create new script files for SQL Server CE, open existing ones, and save the files to a directory. You can also save frequently used SQL
statements directly in SQL Server CE Query Analyzer for editing and reuse. The following tasks are performed primarily by using the New, Open, and Save commands
on the SQL menu.

To start a new SQL Server CE script file

● On the SQL menu, tap New. This clears all text from the SQL tab to start a new script file.

To open a SQL Server CE script file

● To open the most recent SQL Server CE script files that were previously accessed, tap the Tools menu, and then tap the file you want to open.

Or

● On the SQL menu, tap Open, and in the Name list box, tap the script file you want to open. If the file you want to open does not appear in the Name list box, in the Folder box, select the directory of the file; and in the
Type box, specify the file type.

To save a SQL Server CE script file

● To save the current script file, on the SQL menu, tap Save. If the file already exists, the most recent version that appears in the SQL tab is saved in its current directory.

Or

● If the script file is new, in the Save As dialog box, enter the appropriate information in the Name, Folder, Type, and Location boxes.

Saving Frequently Used SQL Statements for Editing and Reuse

You can save up to 10 frequently used SQL statements directly in SQL Server CE Query Analyzer, and browse the text of each statement simultaneously to determine
which one you want to open for editing and reuse.

To save SQL statements

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_executing_sql_statements_in_the_sql_tab_533.asp (1 of 2) [22/07/2004 07:35:08 p.m.]


Welcome to the MSDN Library
1. In the SQL tab, select the text you want to save, and then tap the preset button.

Tap to save an SQL statement.

2. In the Button Presets dialog box, tap the preset button number (1 through 10) you want the statement to correspond to. The first line of the statement appears next to the button number. If any SQL statements have been
added previously, the first line of their contents appears next to their assigned button numbers. If the button number corresponds to a previously added statement, the new statement overwrites it.
3. To save, tap OK.

To open a saved statement

● In the SQL tab, tap the preset button number corresponding to the saved statement. If you are not sure which button number to choose, tap the preset button to view the list of saved statements, and then tap Cancel to
return to the SQL tab. The following illustration shows SQL Server CE Query Analyzer as it appears on a Pocket PC device.

A. Tap to open a saved SQL statement. (Tap the number corresponding to the preset button number the statement was saved under.)
B. Tap to view a list of saved SQL statements and their corresponding preset button numbers, or to save an SQL statement. (Text must be entered and selected to save an SQL statement.)

If you edit the SQL statement after opening it, the changes will not be reflected in the Button Presets dialog box. To save the changes, repeat the save process for saving a statement described previously.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_executing_sql_statements_in_the_sql_tab_533.asp (2 of 2) [22/07/2004 07:35:08 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0
MSDN Library Go
Advanced Search SQL Server CE Books Online
Managing Connectivity

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports two methods of connecting to and exchanging data with a Microsoft SQL Server
database: remote data access (RDA) and merge replication.

Topic Description
Up One Level Using Remote Data Access Provides background information about RDA.

Using Remote Data Access (RDA) Using Replication Provides background information about replication.

Using Replication

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_connectivity.asp [22/07/2004 07:37:02 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > Managing Connectivity

Advanced Search
SQL Server CE Books Online
Using Remote Data Access (RDA)

The following topics in this section provide information about using remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE).

Up One Level Topic Description

Introducing RDA
Introducing RDA Provides an overview of RDA, explains how RDA is used, and describes components of RDA.

Planning for RDA Provides background information about RDA, including data access, limitations, and conflict resolution.
Planning for RDA Implementing RDA Describes how to configure Microsoft Internet Information Services (IIS) and SQL Server to support RDA.

Implementing RDA
For information about writing programs that use RDA, see Remote Data Access (RDA). For troubleshooting information, see Troubleshooting.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/lib.../en-us/sqlce/htm/_lce_rda_intro_remote_data_access.asp [22/07/2004 07:38:50 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Remote Data Access (RDA)
Advanced Search

SQL Server CE Books Online


Introducing RDA

Remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) provides a simple way for a Microsoft Windows CE-based application to access
(pull) data from a remote SQL Server database table and store that data in a local SQL
Server CE database table. The application can then read and update the local SQL Server CE
Up One Level database table. SQL Server CE can optionally track all changes that are made to the local
table. The application can later update (push) the changed records from the local table back
Typical Uses of RDA to the SQL Server table.

RDA Architecture
Windows CE-based applications can also use RDA to submit SQL statements to be executed
on a remote SQL Server database. For example, an application could submit SQL
statements that insert, update, or delete records to a remote SQL Server table. Applications
can invoke any SQL statement that does not return a recordset, including a stored
procedure on the remote system. RDA is appropriate when the full functionality of SQL
Server CE merge replication, such as conflict resolution, is not required.

SQL Server CE communicates with SQL Server through Microsoft Internet Information
Services (IIS). By connecting through IIS, RDA takes advantage of IIS authentication and
authorization services. SQL Server can be located behind a firewall or be accessed with
Microsoft Proxy Server. RDA can be performed over both local area networks (LANs) and
wide area networks (WANs).

RDA is well suited to wireless transports. Compression is used to reduce the amount of
transmitted data. Encryption can be used to safeguard sensitive user data during
transmission.

See Also

Planning for RDA

Implementing RDA

Remote Data Access (RDA)

http://msdn.microsoft.com/library/default.asp?url=.../sqlce/htm/_lce_introducing_remote_data_access.asp (1 of 2) [22/07/2004 07:40:35 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=.../sqlce/htm/_lce_introducing_remote_data_access.asp (2 of 2) [22/07/2004 07:40:35 p.m.]


Typical Uses of RDA (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Introducing RDA

SQL Server CE Books Online

Typical Uses of RDA


An application running on a Microsoft® Windows® CE-based device can use remote data access (RDA) for:

● Downloading data.

An application can pull data from a database in Microsoft SQL Server™ to a database in Microsoft SQL Server 2000 Windows CE Edition (SQL Server CE). For example, an application might download a
company employee directory, product price list, or product catalog to the Windows CE-based device.

● Capturing and uploading data.

An application can capture data that originates from user-entered forms, a GPS system, a bar code reader, or something similar. The application can store the captured data in a SQL Server CE database
on the device. Periodically, the application can push the captured data from the SQL Server CE database to a SQL Server database.

● Downloading, updating, and uploading data.

An application can pull data from a SQL Server database to a SQL Server CE database. The application can then update the SQL Server CE database. Periodically the application can push the changed data
from the SQL Server CE database to a SQL Server database.

● Submitting SQL statements.

An application can submit SQL statements to be executed on a remote SQL Server database. This is especially useful when the Windows CE-based device is always connected to the network.

An application can use these techniques in combination. For example, a sales support application might download a price list to a Windows CE-based
device as well as capture and upload new orders on the device. The application could also submit SQL statements directly to the SQL Server database.

See Also

Sample Applications

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_rda_intro_typical_uses_of_rda.asp?frame=true [22/07/2004 07:41:14 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Remote Data Access (RDA) > Introducing RDA
Advanced Search

SQL Server CE Books Online

Typical Uses of RDA


An application running on a Microsoft® Windows® CE-based device can use remote data
access (RDA) for:

Up One Level
Typical Uses of RDA ● Downloading data.

RDA Architecture An application can pull data from a database in Microsoft SQL Server™ to a database in Microsoft SQL Server 2000
Windows CE Edition (SQL Server CE). For example, an application might download a company employee directory,
product price list, or product catalog to the Windows CE-based device.

● Capturing and uploading data.

An application can capture data that originates from user-entered forms, a GPS system, a bar code reader, or
something similar. The application can store the captured data in a SQL Server CE database on the device.
Periodically, the application can push the captured data from the SQL Server CE database to a SQL Server
database.

● Downloading, updating, and uploading data.

An application can pull data from a SQL Server database to a SQL Server CE database. The application can then
update the SQL Server CE database. Periodically the application can push the changed data from the SQL Server
CE database to a SQL Server database.

● Submitting SQL statements.

An application can submit SQL statements to be executed on a remote SQL Server database. This is especially
useful when the Windows CE-based device is always connected to the network.

An application can use these techniques in combination. For example, a sales support
application might download a price list to a Windows CE-based device as well as capture and
upload new orders on the device. The application could also submit SQL statements directly
to the SQL Server database.

See Also

Sample Applications

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_rda_intro_typical_uses_of_rda.asp [22/07/2004 07:41:35 p.m.]


RDA Architecture (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Introducing RDA

SQL Server CE Books Online

RDA Architecture
Remote data access (RDA) uses the Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) Database Engine, SQL Server CE Client Agent, and SQL
Server CE Server Agent.

The following illustration shows how these components work together.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_rda_intro_rda_architecture.asp?frame=true (1 of 2) [22/07/2004 07:42:27 p.m.]


RDA Architecture (SQL Server CE Books Online)

SQL Server CE Database Engine

The SQL Server CE Database Engine manages the SQL Server data store on the Windows CE-based device. For pull operations that are tracked, the Database
Engine tracks all database records that are inserted, updated, or deleted by maintaining a small amount of change tracking information with each record. If indexes
exist on the SQL Server data, RDA also supports creating indexes on the local data.

SQL Server CE Client Agent

SQL Server CE Client Agent is the primary RDA component on the Windows CE-based device. It implements the RDA object interface. Applications call this interface
to programmatically control RDA. The following table describes the action the SQL Server CE Client takes in response to a call to an RDA object method.

Method Action
Pull Forwards the request to SQL Server CE Server Agent through HTTP. When SQL Server CE Client Agent receives the recordset back from SQL Server, it stores the recordset in the SQL
Server CE database.

Push Extracts all inserted, updated, and deleted records from the SQL Server CE database and sends them to SQL Server CE Server Agent through HTTP.

SubmitSQL Forwards the specified SQL request to SQL Server CE Server Agent through HTTP.

SQL Server CE Server Agent

SQL Server CE Server Agent is a component responsible for handling the HTTP requests made by SQL Server CE Client Agent.

Method Action
Pull Receives the request from SQL Server CE Client Agent, connects to SQL Server through the OLE DB Provider for SQL Server and invokes the client's SQL statement. SQL Server CE
Server Agent returns the resulting recordset to SQL Server CE Client Agent through HTTP. For more information, see Using the Pull Method.

Push Receives all the inserted, updated, and deleted records from SQL Server CE Client Agent, connects to SQL Server through OLE DB, and inserts, updates, or deletes the records in the
SQL Server database. If errors occur, SQL Server CE Server Agent reports the errors to the SQL Server CE Client Agent through HTTP. For more information, see Using the Push
Method.

SubmitSQL Receives the specified SQL request from SQL Server CE Client Agent through HTTP, connects to SQL Server through OLE DB and invokes the client's SQL statement. If errors occur,
SQL Server CE Server Agent reports the errors to SQL Server CE Client Agent through HTTP. For more information, see Using the SubmitSQL Method.

SQL Server CE Server Agent uses an internal .in and .out file to manage the exchange of data between SQL Server and SQL Server CE.

See Also

Client and Server Environments

Connectivity Solutions

RDA Programmer's Reference for eMbedded Visual Tools

.NET Compact Framework Data Providers

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_rda_intro_rda_architecture.asp?frame=true (2 of 2) [22/07/2004 07:42:27 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Introducing RDA

Advanced Search
SQL Server CE Books Online

RDA Architecture
Remote data access (RDA) uses the Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) Database Engine, SQL Server CE Client Agent, and SQL
Server CE Server Agent.

Up One Level The following illustration shows how these components work together.
Typical Uses of RDA
RDA Architecture

SQL Server CE Database Engine

The SQL Server CE Database Engine manages the SQL Server data store on the Windows CE-based device. For pull operations that are tracked, the Database
Engine tracks all database records that are inserted, updated, or deleted by maintaining a small amount of change tracking information with each record. If indexes
exist on the SQL Server data, RDA also supports creating indexes on the local data.

SQL Server CE Client Agent

SQL Server CE Client Agent is the primary RDA component on the Windows CE-based device. It implements the RDA object interface. Applications call this interface
to programmatically control RDA. The following table describes the action the SQL Server CE Client takes in response to a call to an RDA object method.

http://msdn.microsoft.com/library/default.asp?url=/...en-us/sqlce/htm/_lce_rda_intro_rda_architecture.asp (1 of 2) [22/07/2004 07:42:43 p.m.]


Welcome to the MSDN Library

Method Action
Pull Forwards the request to SQL Server CE Server Agent through HTTP. When SQL Server CE Client Agent receives the recordset back from SQL Server, it stores the recordset in the SQL
Server CE database.

Push Extracts all inserted, updated, and deleted records from the SQL Server CE database and sends them to SQL Server CE Server Agent through HTTP.

SubmitSQL Forwards the specified SQL request to SQL Server CE Server Agent through HTTP.

SQL Server CE Server Agent

SQL Server CE Server Agent is a component responsible for handling the HTTP requests made by SQL Server CE Client Agent.

Method Action
Pull Receives the request from SQL Server CE Client Agent, connects to SQL Server through the OLE DB Provider for SQL Server and invokes the client's SQL statement. SQL Server CE
Server Agent returns the resulting recordset to SQL Server CE Client Agent through HTTP. For more information, see Using the Pull Method.

Push Receives all the inserted, updated, and deleted records from SQL Server CE Client Agent, connects to SQL Server through OLE DB, and inserts, updates, or deletes the records in the
SQL Server database. If errors occur, SQL Server CE Server Agent reports the errors to the SQL Server CE Client Agent through HTTP. For more information, see Using the Push
Method.

SubmitSQL Receives the specified SQL request from SQL Server CE Client Agent through HTTP, connects to SQL Server through OLE DB and invokes the client's SQL statement. If errors occur,
SQL Server CE Server Agent reports the errors to SQL Server CE Client Agent through HTTP. For more information, see Using the SubmitSQL Method.

SQL Server CE Server Agent uses an internal .in and .out file to manage the exchange of data between SQL Server and SQL Server CE.

See Also

Client and Server Environments

Connectivity Solutions

RDA Programmer's Reference for eMbedded Visual Tools

.NET Compact Framework Data Providers

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...en-us/sqlce/htm/_lce_rda_intro_rda_architecture.asp (2 of 2) [22/07/2004 07:42:43 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Remote Data Access (RDA)
Advanced Search

SQL Server CE Books Online


Planning for RDA

The following topics in this section provide background information to consider before
implementing remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE
Edition (SQL Server CE). Information is provided about what data can be accessed through
RDA, as well as information regarding general limitations with RDA.
Up One Level
Supported Data Types and Data Type Mappings ● Supported Data Types and Data Type Mappings
RDA Limitations
RDA Limitations

● RDA Conflict Detection and Resolution

RDA Conflict Detection and Resolution

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_rda_plan_planning_for_rda.asp [22/07/2004 07:43:23 p.m.]


Supported Data Types and Data Type Mappings (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Planning for RDA

SQL Server CE Books Online

Supported Data Types and Data Type Mappings


The following tables show the data type mappings that are performed when remote data access (RDA) is used to access data in a Microsoft® SQL Server™
database.

SQL Server data type SQL Server CE data type


bigint (int 8) bigint (int 8)

binary (n) binary (n) or image


If the length of the data is 510 bytes or less, RDA maps the SQL Server binary data to the Microsoft SQL Server 2000 Windows® CE Edition (SQL Server CE)
binary. If the data is more than 510 bytes, RDA maps it to SQL Server CE image.
If the length of the image data exceeds the length of the binary column, pushing tracked data back to SQL Server fails.

bit bit

character national character or ntext


(synonym: If the length of the data is 255 characters or less, RDA maps the SQL Server character data to SQL Server CE national character. If the data is more than 255
char) characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the character column, pushing tracked data back to SQL Server fails.

character varying national character varying or ntext


(synonyms: If the length of the data is 255 characters or less, RDA maps the SQL Server character varying data to SQL Server CE national character varying. If the data is
char varying more than 255 characters, RDA maps it to SQL Server CE ntext.
varchar) If the length of the ntext data exceeds the length of the character varying column, pushing tracked data back to SQL Server fails.

datetime datetime

decimal See numeric.

double precision double precision

float float

image image

integer (int 4) integer (int 4)


(synonym:
int)

money money

national character national character


(synonyms: If the length of the data is 255 characters or less, RDA maps the SQL Server national character data to SQL Server CE national character. If the data is more
national character, than 255 characters, RDA maps it to SQL Server CE ntext.
nchar) If the length of the ntext data exceeds the length of the national character column, pushing tracked data back to SQL Server fails.

ntext ntext

numeric numeric
(synonyms:
decimal, dec)

national character varying national character varying


(synonyms: If the data length is 255 characters or less, RDA maps the SQL Server national character varying data to SQL Server CE national character varying. If the data
national char varying, nvarchar) is more than 255 characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the national character varying column, pushing tracked data back to SQL Server fails.

real real

smalldatetime datetime
If the precision of the datetime data exceeds the precision of the smalldatetime column, pushing tracked data back to SQL Server fails.

smallint (int 2) smallint (int 2)

smallmoney money
If the precision of the money data exceeds the precision of the smallmoney column, pushing tracked data back to SQL Server fails.

sql_variant Not supported


The Pull method fails if the recordset contains a column with the data type sql_variant.

text ntext
If the length of the text data exceeds 1,073,741,823 characters, pulling data from SQL Server fails.

timestamp Not supported


The Pull method fails if the recordset contains a timestamp column.

tinyint (int 1) tinyint (int 1)

uniqueidentifier uniqueidentifier

varbinary (n) varbinary (n) or image


If the length of the data is 510 bytes or less, RDA maps the SQL Server varbinary data to SQL Server CE varbinary. If the data is more than 510 bytes, RDA maps
it to SQL Server CE image.
If the length of the image data exceeds the length of the varbinary column, pushing tracked data back to SQL Server fails.

Using Data Types

When possible, choose data types that are supported by both SQL Server and SQL Server CE. As a result, RDA does not have to perform data mapping. When this
is not possible, your application should validate the values stored in SQL Server CE to ensure that RDA can map these values between SQL Server and SQL Server
CE.

You cannot pull data from a table having a primary key of type char, nchar, varchar, or nvarchar with length greater than 255 characters. These column types
are mapped to ntext, and a primary key cannot be created on an ntext column.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_accessing_data.asp?frame=true (1 of 2) [22/07/2004 07:44:11 p.m.]


Supported Data Types and Data Type Mappings (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_accessing_data.asp?frame=true (2 of 2) [22/07/2004 07:44:11 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Planning for RDA
MSDN Library Go
Advanced Search SQL Server CE Books Online

Supported Data Types and Data Type Mappings


The following tables show the data type mappings that are performed when remote data access (RDA) is used to access data in a Microsoft® SQL Server™
database.

Up One Level SQL Server data type SQL Server CE data type

Supported Data Types and Data Type Mappings bigint (int 8) bigint (int 8)

binary (n) binary (n) or image

RDA Limitations If the length of the data is 510 bytes or less, RDA maps the SQL Server binary data to the Microsoft SQL Server 2000 Windows® CE Edition (SQL Server CE)
binary. If the data is more than 510 bytes, RDA maps it to SQL Server CE image.
If the length of the image data exceeds the length of the binary column, pushing tracked data back to SQL Server fails.
RDA Conflict Detection and Resolution bit bit

character national character or ntext


(synonym: If the length of the data is 255 characters or less, RDA maps the SQL Server character data to SQL Server CE national character. If the data is more than 255
char) characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the character column, pushing tracked data back to SQL Server fails.

character varying national character varying or ntext


(synonyms: If the length of the data is 255 characters or less, RDA maps the SQL Server character varying data to SQL Server CE national character varying. If the data is
char varying more than 255 characters, RDA maps it to SQL Server CE ntext.
varchar) If the length of the ntext data exceeds the length of the character varying column, pushing tracked data back to SQL Server fails.

datetime datetime

decimal See numeric.

double precision double precision

float float

image image

integer (int 4) integer (int 4)


(synonym:
int)

money money

national character national character


(synonyms: If the length of the data is 255 characters or less, RDA maps the SQL Server national character data to SQL Server CE national character. If the data is more
national character, than 255 characters, RDA maps it to SQL Server CE ntext.
nchar) If the length of the ntext data exceeds the length of the national character column, pushing tracked data back to SQL Server fails.

ntext ntext

numeric numeric
(synonyms:
decimal, dec)

national character varying national character varying


(synonyms: If the data length is 255 characters or less, RDA maps the SQL Server national character varying data to SQL Server CE national character varying. If the data
national char varying, nvarchar) is more than 255 characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the national character varying column, pushing tracked data back to SQL Server fails.

real real

smalldatetime datetime
If the precision of the datetime data exceeds the precision of the smalldatetime column, pushing tracked data back to SQL Server fails.

smallint (int 2) smallint (int 2)

smallmoney money
If the precision of the money data exceeds the precision of the smallmoney column, pushing tracked data back to SQL Server fails.

sql_variant Not supported


The Pull method fails if the recordset contains a column with the data type sql_variant.

text ntext
If the length of the text data exceeds 1,073,741,823 characters, pulling data from SQL Server fails.

timestamp Not supported


The Pull method fails if the recordset contains a timestamp column.

tinyint (int 1) tinyint (int 1)

uniqueidentifier uniqueidentifier

varbinary (n) varbinary (n) or image


If the length of the data is 510 bytes or less, RDA maps the SQL Server varbinary data to SQL Server CE varbinary. If the data is more than 510 bytes, RDA maps
it to SQL Server CE image.
If the length of the image data exceeds the length of the varbinary column, pushing tracked data back to SQL Server fails.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_accessing_data.asp (1 of 2) [22/07/2004 07:44:15 p.m.]


Welcome to the MSDN Library

Using Data Types

When possible, choose data types that are supported by both SQL Server and SQL Server CE. As a result, RDA does not have to perform data mapping. When this
is not possible, your application should validate the values stored in SQL Server CE to ensure that RDA can map these values between SQL Server and SQL Server
CE.

You cannot pull data from a table having a primary key of type char, nchar, varchar, or nvarchar with length greater than 255 characters. These column types
are mapped to ntext, and a primary key cannot be created on an ntext column.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_accessing_data.asp (2 of 2) [22/07/2004 07:44:15 p.m.]


RDA Limitations (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Planning for RDA

SQL Server CE Books Online

RDA Limitations
Remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has the following limitations:

● Case sensitivity

SQL Server CE databases are not case-sensitive.

● ROWGUID

When using RDA to pull data from a table in SQL Server that also participates in replication on the server, you must exclude the system column with the ROWGUIDCOL attribute. By default, the name of
this column is RowGuid.

For example, for the SQLSelectString parameter in the Pull method, use SELECT CompanyName, ContactName FROM Customers instead of SELECT * FROM Customers.

● Triggers

SQL Server CE does not support triggers; however, triggers can reside on the SQL Server table from which RDA pulled data. For tracked tables, the SQL Server triggers can be executed when changes are
pushed back to SQL Server. It might be necessary to specify SET NOCOUNT ON in the trigger logic. This indicates not to return the number of rows affected, because a response of no rows affected results
in an error for the RDA push method.

● Tables and columns

For tracked tables, the number of columns available = 253 (255 - 2 system columns). SQL Server CE allocates two system columns: S_BinaryKey and S_Operation. These columns are protected and
used for tracked RDA tables.

● Computed columns

Not supported. The Pull method fails if the recordset contains computed columns.

Schema Limitations

SQL Server CE is capable of tracking changes to the resulting SQL Server CE table. By specifying the appropriate tracking option, SQL Server CE tracks all
inserts, updates, and deletes made to the local SQL Server CE table. The application can then call the Push method to propagate these changes back to
the original SQL Server table.

RDA tracked Pull and Push methods use optimistic concurrency control. SQL Server does not keep pulled records locked. When the application calls
Push, the changes made to the local SQL Server CE database are unconditionally applied to the SQL Server database. This may cause changes made by
other users of the SQL Server database to be lost.

You should use tracked Pull and Push methods when the records you are updating are logically partitioned and conflicts are unlikely. For example,
tracked Pull and Push methods might be used in a field service application which tracks each technician who has a unique list of service calls.

You can make the following schema changes to a SQL Server CE table created with a tracked Pull:

● Change the seed or increment of the identity column


● Add or drop DEFAULT constraints
● Add or drop foreign keys
● Add or drop indexes
● Drop the table

You cannot make any of the following schema changes to a SQL Server table while a tracked Pull is still processing. To make these SQL Server table
schema changes, you must drop the SQL Server CE table and repull the changed SQL Server table:

● Add, drop, or rename columns


● Rename the table
● Drop a primary key
● Alter a data type definition

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_limitations_on_pulling_data_705.asp?frame=true (1 of 2) [22/07/2004 07:45:02 p.m.]


RDA Limitations (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_limitations_on_pulling_data_705.asp?frame=true (2 of 2) [22/07/2004 07:45:02 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Remote Data Access (RDA) > Planning for RDA
Advanced Search

SQL Server CE Books Online

RDA Limitations
Remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) has the following limitations:

Up One Level
Supported Data Types and Data Type Mappings ● Case sensitivity

RDA Limitations SQL Server CE databases are not case-sensitive.

RDA Conflict Detection and Resolution ● ROWGUID

When using RDA to pull data from a table in SQL Server that also participates in replication on the server, you
must exclude the system column with the ROWGUIDCOL attribute. By default, the name of this column is
RowGuid.

For example, for the SQLSelectString parameter in the Pull method, use SELECT CompanyName, ContactName
FROM Customers instead of SELECT * FROM Customers.

● Triggers

SQL Server CE does not support triggers; however, triggers can reside on the SQL Server table from which RDA
pulled data. For tracked tables, the SQL Server triggers can be executed when changes are pushed back to SQL
Server. It might be necessary to specify SET NOCOUNT ON in the trigger logic. This indicates not to return the
number of rows affected, because a response of no rows affected results in an error for the RDA push method.

● Tables and columns

For tracked tables, the number of columns available = 253 (255 - 2 system columns). SQL Server CE allocates two
system columns: S_BinaryKey and S_Operation. These columns are protected and used for tracked RDA tables.

● Computed columns

Not supported. The Pull method fails if the recordset contains computed columns.

Schema Limitations

SQL Server CE is capable of tracking changes to the resulting SQL Server CE table. By
specifying the appropriate tracking option, SQL Server CE tracks all inserts, updates, and
deletes made to the local SQL Server CE table. The application can then call the Push
method to propagate these changes back to the original SQL Server table.

RDA tracked Pull and Push methods use optimistic concurrency control. SQL Server does
not keep pulled records locked. When the application calls Push, the changes made to the
local SQL Server CE database are unconditionally applied to the SQL Server database. This
may cause changes made by other users of the SQL Server database to be lost.

You should use tracked Pull and Push methods when the records you are updating are
logically partitioned and conflicts are unlikely. For example, tracked Pull and Push methods
might be used in a field service application which tracks each technician who has a unique
list of service calls.

You can make the following schema changes to a SQL Server CE table created with a
tracked Pull:

● Change the seed or increment of the identity column


● Add or drop DEFAULT constraints
● Add or drop foreign keys
● Add or drop indexes
● Drop the table

You cannot make any of the following schema changes to a SQL Server table while a
tracked Pull is still processing. To make these SQL Server table schema changes, you must
drop the SQL Server CE table and repull the changed SQL Server table:

http://msdn.microsoft.com/library/default.asp?url=/.../sqlce/htm/_lce_limitations_on_pulling_data_705.asp (1 of 2) [22/07/2004 07:45:29 p.m.]


Welcome to the MSDN Library

● Add, drop, or rename columns


● Rename the table
● Drop a primary key
● Alter a data type definition

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/.../sqlce/htm/_lce_limitations_on_pulling_data_705.asp (2 of 2) [22/07/2004 07:45:29 p.m.]


RDA Conflict Detection and Resolution (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA) > Planning for RDA

SQL Server CE Books Online

RDA Conflict Detection and Resolution


Remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides a limited conflict mechanism to resolve
conflicts during a push operation.

Important Conflicting rows in RDA are strictly defined as insert, update, or delete operations, which fail due to an error when
pushed to the SQL Server table. Changes to data by different users are not considered a conflict if they do not result in error.

Although RDA does not provide a specific resolver as replication does, SQL Server CE provides an error table that captures all conflicting rows. You can
specify the error table as part of the Pull method. Using the error table, you can develop Microsoft Windows CE-based applications to manage conflict
detection and resolution.

In SQL Server CE RDA, a conflict exists when a row cannot be pushed up to SQL Server. SQL Server CE supports only row-level tracking; therefore, some
rows succeed and others fail depending on what options are selected in a Push method.

Nonbatch Transactions

During nonbatch transactions (BATCHINGOFF option), conflicts are detected at the row level. The conflicting row is returned to the application and stored
in a specified error table. For example, if the application attempts to push a row to SQL Server that is not valid, that row is returned to the application and
stored in the error table along with an error message indicating the conflict.

When a conflicting row is returned to the error table, that row is removed from the original Windows CE-based database. You must design the application
to allow the user to correct the conflicting data and merge the conflicting data back into the original Windows CE-based database.

Batch Transactions

RDA also supports a batch push (BATCHINGON option) that requires all rows to succeed for the entire push to process. If one row fails, the entire push
transaction fails and no data is updated. The conflicting row(s) is copied to the error table. Unlike the nonbatched push, the original Windows CE-based
database is kept intact. You must design the application to allow the user to correct the conflicting data and merge it back into the original Windows CE-
based database. The error table is automatically cleaned before a conflicting row is copied so only the conflicts from the last push operation exist in the
table.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc..._conflict_detection_and_resolution_579.asp?frame=true [22/07/2004 07:46:15 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Remote Data Access (RDA) > Planning for RDA
Advanced Search

SQL Server CE Books Online

RDA Conflict Detection and


Resolution
Up One Level Remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) provides a limited conflict mechanism to resolve conflicts during a push
Supported Data Types and Data Type Mappings operation.

RDA Limitations
RDA Conflict Detection and Resolution Important Conflicting rows in RDA are strictly defined as insert,
update, or delete operations, which fail due to an error when pushed
to the SQL Server table. Changes to data by different users are not
considered a conflict if they do not result in error.

Although RDA does not provide a specific resolver as replication does, SQL Server CE
provides an error table that captures all conflicting rows. You can specify the error table as
part of the Pull method. Using the error table, you can develop Microsoft Windows CE-
based applications to manage conflict detection and resolution.

In SQL Server CE RDA, a conflict exists when a row cannot be pushed up to SQL Server.
SQL Server CE supports only row-level tracking; therefore, some rows succeed and others
fail depending on what options are selected in a Push method.

Nonbatch Transactions

During nonbatch transactions (BATCHINGOFF option), conflicts are detected at the row
level. The conflicting row is returned to the application and stored in a specified error table.
For example, if the application attempts to push a row to SQL Server that is not valid, that
row is returned to the application and stored in the error table along with an error message
indicating the conflict.

When a conflicting row is returned to the error table, that row is removed from the original
Windows CE-based database. You must design the application to allow the user to correct
the conflicting data and merge the conflicting data back into the original Windows CE-based
database.

Batch Transactions

RDA also supports a batch push (BATCHINGON option) that requires all rows to succeed for
the entire push to process. If one row fails, the entire push transaction fails and no data is
updated. The conflicting row(s) is copied to the error table. Unlike the nonbatched push, the
original Windows CE-based database is kept intact. You must design the application to allow
the user to correct the conflicting data and merge it back into the original Windows CE-
based database. The error table is automatically cleaned before a conflicting row is copied
so only the conflicts from the last push operation exist in the table.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr.../htm/_lce_rda_conflict_detection_and_resolution_579.asp [22/07/2004 07:46:36 p.m.]


Implementing RDA (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA)

SQL Server CE Books Online


Implementing RDA

To implement remote data access in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE), in addition to following the general installation and
connectivity requirements, you must configure SQL Server with the appropriate access rights.

Configuring RDA Database Access


You must grant database access based on how Microsoft Internet Information Services (IIS) and SQL Server authentication are configured.

To configure the database access option

1. Start SQL Server Enterprise Manager. In the left pane, expand Microsoft SQL Servers, SQL Server Group, the computer containing the publication, Security, and then click Logins.
2. In the right pane, right-click the user ID that is requiring access to the database and click Properties. The user ID depends on how IIS and SQL Server Authentication are configured.

IIS authentication mode SQL Server authentication mode Must grant database access to
Anonymous access Integrated Windows authentication computername\IUSR_computername or the configured IIS anonymous user account.

Basic authentication Integrated Windows authentication The IIS client's user or group.

Integrated Windows authentication Integrated Windows authentication The IIS client's user or group. (This configuration is supported only if SQL Server and IIS are
running on the same computer.)

Anonymous access, Basic authentication, or Integrated SQL Server authentication The user specified in the SQL Server OLEDBConnectionString parameter of the Pull, Push,
Windows authentication or SubmitSQL method in the RDA object.

3. Click the Database Access tab.


4. Select the Permit check box for the database.
5. To close SQL Server Login Properties, click OK, and then close SQL Server Enterprise Manager.

See Also

Installing SQL Server CE

Configuring Security for Connectivity

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_rda_impl_implementing_rda.asp?frame=true [22/07/2004 07:57:10 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Remote Data Access (RDA)
MSDN Library Go
Advanced Search SQL Server CE Books Online
Implementing RDA

To implement remote data access in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE), in addition to following the general installation and
connectivity requirements, you must configure SQL Server with the appropriate access rights.

Up One Level
Configuring RDA Database Access
Introducing RDA
You must grant database access based on how Microsoft Internet Information Services (IIS) and SQL Server authentication are configured.
Planning for RDA
Implementing RDA
To configure the database access option

1. Start SQL Server Enterprise Manager. In the left pane, expand Microsoft SQL Servers, SQL Server Group, the computer containing the publication, Security, and then click Logins.
2. In the right pane, right-click the user ID that is requiring access to the database and click Properties. The user ID depends on how IIS and SQL Server Authentication are configured.

IIS authentication mode SQL Server authentication mode Must grant database access to
Anonymous access Integrated Windows authentication computername\IUSR_computername or the configured IIS anonymous user account.

Basic authentication Integrated Windows authentication The IIS client's user or group.

Integrated Windows authentication Integrated Windows authentication The IIS client's user or group. (This configuration is supported only if SQL Server and IIS are
running on the same computer.)

Anonymous access, Basic authentication, or Integrated SQL Server authentication The user specified in the SQL Server OLEDBConnectionString parameter of the Pull, Push,
Windows authentication or SubmitSQL method in the RDA object.

3. Click the Database Access tab.


4. Select the Permit check box for the database.
5. To close SQL Server Login Properties, click OK, and then close SQL Server Enterprise Manager.

See Also

Installing SQL Server CE

Configuring Security for Connectivity

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_rda_impl_implementing_rda.asp (1 of 2) [22/07/2004 07:57:40 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_rda_impl_implementing_rda.asp (2 of 2) [22/07/2004 07:57:40 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > Managing Connectivity

Advanced Search
SQL Server CE Books Online
Using Replication

The following topics in this section provide information about using replication in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).

Topic Description
Up One Level Introducing Replication Provides an overview of SQL Server CE replication. This topic explains how replication is used and describes the components of SQL Server CE
replication.
Introducing Replication Planning for Replication Provides background information about SQL Server CE replication including data access, limitations, and conflict resolution.

Planning for Replication Implementing Replication Describes how you can configure SQL Server to support SQL Server CE replication.

Implementing Replication
For information about writing programs that use replication, see Replication. For information about problems you may encounter and ways to resolve them, see
Troubleshooting.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_intro_replication.asp [22/07/2004 07:58:19 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication
Advanced Search

SQL Server CE Books Online


Introducing Replication

Replication in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) is
based on Microsoft SQL Server 2000 merge replication. Merge replication is ideally suited to
portable devices because it allows data to be updated autonomously on the portable device
and the server. The data can later be merged when the device is connected to an instance
Up One Level of SQL Server.

Typical Uses of Replication


In SQL Server CE, replication is message-based. SQL Server CE synchronizes with SQL
Replication Architecture Server by establishing an HTTP connection to the SQL Server Publisher through Microsoft
Internet Information Services (IIS). By connecting through IIS, replication takes advantage
How Replication Works of IIS authentication and authorization services. You can locate the Publisher behind a
firewall or provide access to it using Microsoft Internet Security and Acceleration Server
2000. Replication can be performed over local area networks (LANs) and wide area
networks (WANs). Using Microsoft ActiveSync®, you can communicate with SQL Server
through the desktop computer's network connection, eliminating the requirement for the
Windows CE-based device to have a network card or modem. For more information, see
Using SQL Server CE Relay with an ActiveSync System.

The replication communication protocol is designed for wireless transports. The protocol
uses compression to reduce the amount of transmitted data, and supports the use of
encryption to safeguard sensitive user data during transmission. Following a communication
failure, transmission resumes from the last successfully transmitted message buffer.

SQL Server CE replication offers row and column filtering, which enable you to define and
maintain subsets of data that can be published to different sites. Row filtering can be used
to publish a subset of rows in a published table. For example, in a service organization, each
service representative may only need to receive the customer records for the accounts they
service. Column filtering can be used to publish a subset of columns in a published table.
For example, a column filter can be used to eliminate large text or image columns that you
may not want to publish to a Windows CE-based device.

Row and column filtering can be used on the same article within a publication. You can use
filtering to specify the data that is published to each Windows CE-based device. For more
information, see "Filtering Published Data" in SQL Server Books Online.

See Also

Planning for Replication

Implementing Replication

Replication

http://msdn.microsoft.com/library/default.asp?url=/l...qlce/htm/_lce_repl_intro_introducing_replication.asp (1 of 2) [22/07/2004 07:58:48 p.m.]


Welcome to the MSDN Library

Troubleshooting

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/l...qlce/htm/_lce_repl_intro_introducing_replication.asp (2 of 2) [22/07/2004 07:58:48 p.m.]


Typical Uses of Replication (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Introducing Replication

SQL Server CE Books Online

Typical Uses of Replication


An application based on Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) can use replication for:

● Downloading data.

An application running on the Microsoft Windows CE-based device can subscribe to a SQL Server publication. This causes the subscription to be downloaded to a SQL Server CE database on the device. For
example, an application might subscribe to a company employee directory, a product price list, or a product catalog.

● Capturing and uploading data.

An application running on the Windows CE-based device can subscribe to a SQL Server publication and download only schema files for the articles in the publication, rather than downloading the schema
and the data. The application can capture data that originates from user-entered forms, a GPS system, a bar code reader, or something similar and store the captured data in a SQL Server CE database on
the device. Periodically the application can initiate replication synchronization to transfer the captured data from the SQL Server CE database to the Publisher. From the Publisher, the data can be
propagated to other Subscribers.

● Downloading, updating, and uploading data.

An application running on the Windows CE-based device can subscribe to a SQL Server publication. This causes the subscription to be downloaded to a SQL Server CE database on the device. The
application can then update the SQL Server CE database. Periodically the application can initiate replication synchronization. During synchronization, the updates made to the subscription are sent to the
Publisher, where they are merged into the publication database. Similarly, changes made at the Publisher since the initial download or most recent merge are sent to the Windows CE-based device, where
they are merged into the subscription database. These periodic merge operations keep the data on the server and the Windows CE-based device synchronized.

Applications can use these techniques in combination. For example, a sales support application downloads data to publish a price list to a Windows CE-
based device. The application captures new orders on the device. These orders are then sent to the Publisher on the computer running SQL Server. The
application also downloads customer information to the Windows CE-based device. The customer information is updated on the device, and the resulting
changes are uploaded back to the Publisher.

See Also

Sample Applications

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_intro_typical_uses_of_replication.asp?frame=true [22/07/2004 07:59:02 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Introducing Replication
Advanced Search

SQL Server CE Books Online

Typical Uses of Replication


An application based on Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE) can use replication for:

Up One Level
Typical Uses of Replication ● Downloading data.

Replication Architecture An application running on the Microsoft Windows CE-based device can subscribe to a SQL Server publication. This

How Replication Works


causes the subscription to be downloaded to a SQL Server CE database on the device. For example, an application
might subscribe to a company employee directory, a product price list, or a product catalog.

● Capturing and uploading data.

An application running on the Windows CE-based device can subscribe to a SQL Server publication and download
only schema files for the articles in the publication, rather than downloading the schema and the data. The
application can capture data that originates from user-entered forms, a GPS system, a bar code reader, or
something similar and store the captured data in a SQL Server CE database on the device. Periodically the
application can initiate replication synchronization to transfer the captured data from the SQL Server CE database
to the Publisher. From the Publisher, the data can be propagated to other Subscribers.

● Downloading, updating, and uploading data.

An application running on the Windows CE-based device can subscribe to a SQL Server publication. This causes the
subscription to be downloaded to a SQL Server CE database on the device. The application can then update the
SQL Server CE database. Periodically the application can initiate replication synchronization. During
synchronization, the updates made to the subscription are sent to the Publisher, where they are merged into the
publication database. Similarly, changes made at the Publisher since the initial download or most recent merge are
sent to the Windows CE-based device, where they are merged into the subscription database. These periodic
merge operations keep the data on the server and the Windows CE-based device synchronized.

Applications can use these techniques in combination. For example, a sales support
application downloads data to publish a price list to a Windows CE-based device. The
application captures new orders on the device. These orders are then sent to the Publisher
on the computer running SQL Server. The application also downloads customer information
to the Windows CE-based device. The customer information is updated on the device, and
the resulting changes are uploaded back to the Publisher.

See Also

Sample Applications

http://msdn.microsoft.com/library/default.asp?url=/l.../htm/_lce_repl_intro_typical_uses_of_replication.asp (1 of 2) [22/07/2004 07:59:32 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/l.../htm/_lce_repl_intro_typical_uses_of_replication.asp (2 of 2) [22/07/2004 07:59:32 p.m.]


Replication Architecture (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Introducing Replication

SQL Server CE Books Online

Replication Architecture
Replication uses the following components in Microsoft® SQL Server™ 2000 Windows CE Edition (SQL Server CE):

● SQL Server CE Database Engine


● SQL Server CE Client Agent
● SQL Server CE Server Agent
● SQL Server CE Replication Provider

http://msdn.microsoft.com/library/en-us/sqlce/htm/_..._repl_intro_replication_architecture.asp?frame=true (1 of 2) [22/07/2004 07:59:51 p.m.]


Replication Architecture (SQL Server CE Books Online)

SQL Server CE Database Engine

The SQL Server CE Database Engine manages the local database on the Windows CE-based device. For subscription databases, the SQL Server CE
Database Engine tracks all database records that are inserted, updated, or deleted by maintaining a small amount of change tracking information with
each record.

SQL Server CE Client Agent

The SQL Server CE Client Agent is the primary SQL Server CE replication component on the Windows CE-based device. The SQL Server CE Client Agent
implements the SQL Server CE Replication object interface. Applications call this interface to programmatically control replication.

SQL Server CE Server Agent

The SQL Server CE Server Agent is the component responsible for managing the communication between an instance of SQL Server and SQL Server CE.
The SQL Server CE Server Agent handles the HTTP requests made by SQL Server CE Client Agent.

SQL Server Reconciler and SQL Server CE Replication Provider

The SQL Server Reconciler invokes the SQL Server CE Replication Provider when synchronization is performed. Both the SQL Server Reconciler and SQL
Server CE Replication Provider reside on the computer running IIS (on which SQL Server CE Server Tools is installed). When the SQL Server CE Server
Agent starts the SQL Server Reconciler, a Merge Agent at the Publisher is associated with each subscription.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_..._repl_intro_replication_architecture.asp?frame=true (2 of 2) [22/07/2004 07:59:51 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000
MSDN Library Go Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication >
Introducing Replication
Advanced Search

SQL Server CE Books Online

Replication Architecture
Replication uses the following components in Microsoft® SQL Server™ 2000 Windows CE Edition (SQL Server CE):

Up One Level ● SQL Server CE Database Engine

Typical Uses of Replication


● SQL Server CE Client Agent
● SQL Server CE Server Agent
● SQL Server CE Replication Provider

Replication Architecture
How Replication Works

http://msdn.microsoft.com/library/default.asp?url=/l...lce/htm/_lce_repl_intro_replication_architecture.asp (1 of 2) [22/07/2004 08:00:06 p.m.]


Welcome to the MSDN Library

SQL Server CE Database Engine

The SQL Server CE Database Engine manages the local database on the Windows CE-based device. For subscription
databases, the SQL Server CE Database Engine tracks all database records that are inserted, updated, or deleted by
maintaining a small amount of change tracking information with each record.

SQL Server CE Client Agent

The SQL Server CE Client Agent is the primary SQL Server CE replication component on the Windows CE-based device.
The SQL Server CE Client Agent implements the SQL Server CE Replication object interface. Applications call this
interface to programmatically control replication.

SQL Server CE Server Agent

The SQL Server CE Server Agent is the component responsible for managing the communication between an instance of
SQL Server and SQL Server CE. The SQL Server CE Server Agent handles the HTTP requests made by SQL Server CE
Client Agent.

SQL Server Reconciler and SQL Server CE Replication Provider

The SQL Server Reconciler invokes the SQL Server CE Replication Provider when synchronization is performed. Both the
SQL Server Reconciler and SQL Server CE Replication Provider reside on the computer running IIS (on which SQL
Server CE Server Tools is installed). When the SQL Server CE Server Agent starts the SQL Server Reconciler, a Merge
Agent at the Publisher is associated with each subscription.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/l...lce/htm/_lce_repl_intro_replication_architecture.asp (2 of 2) [22/07/2004 08:00:06 p.m.]


How Replication Works (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Introducing Replication

SQL Server CE Books Online

How Replication Works


This topic provides a general description about how merge replication in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) works. For
detailed information about merge replication, see SQL Server Books Online.

SQL Server CE merge replication uses this process:

1. Data is published.

You create a publication containing SQL Server data that will be published to other sites, including Microsoft Windows CE-based devices running SQL Server CE. (A publication is a collection of articles. An
article is a table that is enabled for replication.)

2. Subscriptions to the publications are created.

A Windows CE-based application subscribes to the publication by using the SQL Server CE Replication object with Microsoft eMbedded Visual Tools or the SqlCeReplication class with the .NET Compact
Framework Data Provider for SQL Server CE. When the subscription is created, the initial snapshot is downloaded from the Distributor to create the subscription database on the Windows CE-based device.

3. Data at the Subscriber is updated.

The subscription database on the Windows CE-based device is updated by applications running on that device.

4. Data is synchronized.

Periodically, updates made at the Subscriber are sent to the Publisher and merged with updates made at the Publisher and updates propagated to the Publisher from other Subscribers. Similarly, changes
made at the Publisher and other Subscribers since the initial download or the most recent merge are sent to the Windows CE-based device, where they are merged into the subscription database.

Publishing Data

Publications specify the data that is published. Publications are tailored to different users or groups of users. In some cases, all users need exactly the
same data. For example, every employee might need a copy of the company employee directory. In other cases, different groups of users need different
partitions of data. For example, sales representatives might need one set of data, and customer support technicians need a different set of data.
Individuals might also need data specifically filtered for them. For example, a sales representative might need the data for his or her own customer
accounts.

You can create a publication and specify which articles it contains. Although SQL Server publications may contain other database objects, such as stored
procedures, views, and user-defined functions, SQL Server CE replication ignores these objects and only includes tables in the SQL Server CE subscription.
You specify which of the table rows and columns are included in the article. For more information, see "Replication" in SQL Server Books Online.

Subscribing to Publications

After you define the publication, a Windows CE-based application can subscribe to it by calling the methods exposed by the SQL Server CE Replication
object or the SqlCeReplication class on the Windows CE-based device. When the subscription is created, the initial snapshot from the Distributor is
applied at the subscription database on the Subscriber.

Updating Data at the Subscriber

Windows CE-based applications can update the subscription database. Merge replication allows each subscription database to be updated autonomously.
Updates can occur whether or not the Windows CE-based device is connected to the network and to the Publisher. Each SQL Server CE database uses
change tracking to keep track of INSERT, UPDATE, and DELETE statements made at the SQL Server CE Subscriber.

Synchronizing Data

Typically, users periodically connect the Windows CE-based device to the network. This allows the Windows CE-based application to synchronize changes
made at the Subscriber with changes made at the Publisher. The Windows CE-based application initiates synchronization by calling the synchronization
methods exposed by the Replication object or the SqlCeReplication class. Synchronization is a four-step process:

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_intro_how_replication_works.asp?frame=true (1 of 2) [22/07/2004 08:00:41 p.m.]


How Replication Works (SQL Server CE Books Online)

1. Extract changes and create the input message file.

The SQL Server CE Client Agent extracts all inserted, updated, and deleted records from the subscription database at the SQL Server CE Subscriber and propagates them to the SQL Server CE Server
Agent through HTTP. The SQL Server CE Server Agent creates a new input message file on the computer running Microsoft Internet Information Services (IIS) and writes into that file the insert, update,
and delete changes sent by the SQL Server CE Client Agent.

2. Run the SQL Server Reconciler process and apply changes to the publication database.

When all requests have been written to the input message file, the SQL Server CE Server Agent initiates the SQL Server Reconciler. The SQL Server Reconciler loads the SQL Server CE Replication
Provider, which reads the input message file and informs the SQL Server Reconciler of changes made to the SQL Server CE subscription database that must be applied to the publication database at the
Publisher. During processing, the SQL Server Reconciler detects and resolves conflicts; a conflict occurs when more than one Subscriber or Publisher updates the same record.

Note The SQL Server Reconciler resolves conflicts with conflict resolvers. Use the conflict resolvers provided with SQL Server to implement simple forms of conflict
resolution for your SQL Server CE replication applications or write conflict resolvers to implement more sophisticated solutions. For more information, see "Merge
Replication Conflict Detection and Resolution" in SQL Server Books Online.

3. Create the output message file.

The SQL Server Reconciler informs the SQL Server CE Replication Provider of changes made at the Publisher that must be applied to the subscription database on the Windows CE-based device. The SQL
Server CE Replication Provider writes these changes to an output message file it creates on the computer running IIS.

Note The SQL Server CE Client Agent processes both the input and output message files in logical blocks as it reads from or applies changes to the subscription database
on the Windows CE-based device. By processing each message file in this way, the SQL Server CE Client Agent avoids writing the entire message file on the Windows CE-
based device, conserving storage space.

4. Read the output message file and apply changes to the SQL Server CE subscription database.

When the SQL Server Reconciler process is complete, the SQL Server CE Server Agent locates the output message file created by the SQL Server CE Replication Provider. This file contains the changes that
have occurred at the Publisher and that must be applied to the subscription database on the Windows CE-based device. The SQL Server CE Server Agent reads the output message file and transmits it to
the SQL Server CE Client Agent on the Windows CE-based device. The SQL Server CE Client Agent applies the changes from the output message file to the SQL Server CE subscription database.

After the SQL Server CE Client Agent has incorporated all changes into the subscription database on the Windows CE-based device and conflicts (if any)
have been resolved, the publication and subscription databases are synchronized and data is converged. However, before data values would be identical at
the Publisher and at the Subscribers (because updates can occur continuously), you would need to stop all updates and then run several merges

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_intro_how_replication_works.asp?frame=true (2 of 2) [22/07/2004 08:00:41 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Introducing Replication
Advanced Search

SQL Server CE Books Online

How Replication Works


This topic provides a general description about how merge replication in Microsoft® SQL
Server™ 2000 Windows® CE Edition (SQL Server CE) works. For detailed information about
merge replication, see SQL Server Books Online.
Up One Level
Typical Uses of Replication SQL Server CE merge replication uses this process:
Replication Architecture
How Replication Works 1. Data is published.

You create a publication containing SQL Server data that will be published to other sites, including Microsoft
Windows CE-based devices running SQL Server CE. (A publication is a collection of articles. An article is a table that
is enabled for replication.)

2. Subscriptions to the publications are created.

A Windows CE-based application subscribes to the publication by using the SQL Server CE Replication object with
Microsoft eMbedded Visual Tools or the SqlCeReplication class with the .NET Compact Framework Data Provider
for SQL Server CE. When the subscription is created, the initial snapshot is downloaded from the Distributor to
create the subscription database on the Windows CE-based device.

3. Data at the Subscriber is updated.

The subscription database on the Windows CE-based device is updated by applications running on that device.

4. Data is synchronized.

Periodically, updates made at the Subscriber are sent to the Publisher and merged with updates made at the
Publisher and updates propagated to the Publisher from other Subscribers. Similarly, changes made at the
Publisher and other Subscribers since the initial download or the most recent merge are sent to the Windows CE-
based device, where they are merged into the subscription database.

Publishing Data

Publications specify the data that is published. Publications are tailored to different users or
groups of users. In some cases, all users need exactly the same data. For example, every
employee might need a copy of the company employee directory. In other cases, different
groups of users need different partitions of data. For example, sales representatives might
need one set of data, and customer support technicians need a different set of data.
Individuals might also need data specifically filtered for them. For example, a sales
representative might need the data for his or her own customer accounts.

You can create a publication and specify which articles it contains. Although SQL Server
publications may contain other database objects, such as stored procedures, views, and
user-defined functions, SQL Server CE replication ignores these objects and only includes
tables in the SQL Server CE subscription. You specify which of the table rows and columns
are included in the article. For more information, see "Replication" in SQL Server Books
Online.

Subscribing to Publications

http://msdn.microsoft.com/library/default.asp?url=/...sqlce/htm/_lce_repl_intro_how_replication_works.asp (1 of 3) [22/07/2004 08:01:04 p.m.]


Welcome to the MSDN Library

After you define the publication, a Windows CE-based application can subscribe to it by
calling the methods exposed by the SQL Server CE Replication object or the
SqlCeReplication class on the Windows CE-based device. When the subscription is
created, the initial snapshot from the Distributor is applied at the subscription database on
the Subscriber.

Updating Data at the Subscriber

Windows CE-based applications can update the subscription database. Merge replication
allows each subscription database to be updated autonomously. Updates can occur whether
or not the Windows CE-based device is connected to the network and to the Publisher. Each
SQL Server CE database uses change tracking to keep track of INSERT, UPDATE, and
DELETE statements made at the SQL Server CE Subscriber.

Synchronizing Data

Typically, users periodically connect the Windows CE-based device to the network. This
allows the Windows CE-based application to synchronize changes made at the Subscriber
with changes made at the Publisher. The Windows CE-based application initiates
synchronization by calling the synchronization methods exposed by the Replication object or
the SqlCeReplication class. Synchronization is a four-step process:

1. Extract changes and create the input message file.

The SQL Server CE Client Agent extracts all inserted, updated, and deleted records from the subscription database
at the SQL Server CE Subscriber and propagates them to the SQL Server CE Server Agent through HTTP. The SQL
Server CE Server Agent creates a new input message file on the computer running Microsoft Internet Information
Services (IIS) and writes into that file the insert, update, and delete changes sent by the SQL Server CE Client
Agent.

2. Run the SQL Server Reconciler process and apply changes to the publication database.

When all requests have been written to the input message file, the SQL Server CE Server Agent initiates the SQL
Server Reconciler. The SQL Server Reconciler loads the SQL Server CE Replication Provider, which reads the input
message file and informs the SQL Server Reconciler of changes made to the SQL Server CE subscription database
that must be applied to the publication database at the Publisher. During processing, the SQL Server Reconciler
detects and resolves conflicts; a conflict occurs when more than one Subscriber or Publisher updates the same
record.

Note The SQL Server Reconciler resolves conflicts with conflict resolvers. Use the
conflict resolvers provided with SQL Server to implement simple forms of conflict
resolution for your SQL Server CE replication applications or write conflict
resolvers to implement more sophisticated solutions. For more information, see
"Merge Replication Conflict Detection and Resolution" in SQL Server Books Online.

3. Create the output message file.

The SQL Server Reconciler informs the SQL Server CE Replication Provider of changes made at the Publisher that
must be applied to the subscription database on the Windows CE-based device. The SQL Server CE Replication
Provider writes these changes to an output message file it creates on the computer running IIS.

Note The SQL Server CE Client Agent processes both the input and output
message files in logical blocks as it reads from or applies changes to the
subscription database on the Windows CE-based device. By processing each
message file in this way, the SQL Server CE Client Agent avoids writing the entire
message file on the Windows CE-based device, conserving storage space.

4. Read the output message file and apply changes to the SQL Server CE subscription database.

When the SQL Server Reconciler process is complete, the SQL Server CE Server Agent locates the output message
file created by the SQL Server CE Replication Provider. This file contains the changes that have occurred at the
Publisher and that must be applied to the subscription database on the Windows CE-based device. The SQL Server
CE Server Agent reads the output message file and transmits it to the SQL Server CE Client Agent on the Windows
CE-based device. The SQL Server CE Client Agent applies the changes from the output message file to the SQL
Server CE subscription database.

After the SQL Server CE Client Agent has incorporated all changes into the subscription
database on the Windows CE-based device and conflicts (if any) have been resolved, the
publication and subscription databases are synchronized and data is converged. However,
before data values would be identical at the Publisher and at the Subscribers (because
updates can occur continuously), you would need to stop all updates and then run several
merges

http://msdn.microsoft.com/library/default.asp?url=/...sqlce/htm/_lce_repl_intro_how_replication_works.asp (2 of 3) [22/07/2004 08:01:04 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...sqlce/htm/_lce_repl_intro_how_replication_works.asp (3 of 3) [22/07/2004 08:01:04 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication
Advanced Search

SQL Server CE Books Online


Implementing Replication

The topics in this section describe the configuration requirements for using replication in
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). The topics contain
procedures for performing configuration tasks; some procedures are optional, depending on
your requirements.
Up One Level
Creating the Publication To implement SQL Server CE replication, you must configure SQL Server. Configuring SQL
Server involves the following steps:
Securing the Publication
Configuring the Snapshot Folder
1. Creating the Publication
Checking the Status of the Snapshot Agent 2. Securing the Publication
3. Configuring the Snapshot Folder
4. Checking the Status of the Snapshot Agent

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...s/sqlce/htm/_lce_repl_impl_implementing_replication.asp [22/07/2004 08:01:51 p.m.]


Creating the Publication (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication

SQL Server CE Books Online

Creating the Publication


You create publications for Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) by using standard SQL Server replication tools and
techniques. The easiest way to create a publication is by using the Create Publication Wizard. For more information, see "Replication Wizards" in SQL
Server Books Online.

When you create a publication for SQL Server CE Subscribers by using the Create Publication Wizard, it is important to select the following options:

● On the Select Publication Type page, select Merge publication.


● On the Specify Subscriber Types page, select the Devices running SQL Server CE check box.

By selecting Devices running Windows CE, the following options are automatically configured for the publication:

● Support for anonymous subscriptions


● Character mode snapshot

If you use dynamic filters, SQL Server CE requires that you use the optimize synchronization option. Set this option by using either the Create Publication
Wizard or the stored procedure sp_addmergepublication. For more information about this and other SQL Server CE replication limitations, see
Replication Limitations.

If this is the first publication created for this server, the Create Publication Wizard prompts you to configure the snapshot folder location. The snapshot
folder holds the snapshot files that contain the schema and data for published tables. The SQL Server CE Replication Provider must be able to read these
snapshot files so it can download the files to the Windows CE-based device.

Note The snapshot folder location defaults to an administrative share (for example, C$); you should use an explicit share instead
of the default because the administrative share can be accessed only by an administrator account. For more information, see
Configuring an Explicit Snapshot Folder.

See Also

Securing the Publication

Configuring the Snapshot Folder

Checking the Status of the Snapshot Agent

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_impl_creating_the_publication.asp?frame=true [22/07/2004 08:02:03 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Implementing Replication
Advanced Search

SQL Server CE Books Online

Creating the Publication


You create publications for Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) by using standard SQL Server replication tools and techniques. The easiest way
to create a publication is by using the Create Publication Wizard. For more information, see
Up One Level "Replication Wizards" in SQL Server Books Online.

Creating the Publication


Securing the Publication When you create a publication for SQL Server CE Subscribers by using the Create
Publication Wizard, it is important to select the following options:
Configuring the Snapshot Folder
Checking the Status of the Snapshot Agent ● On the Select Publication Type page, select Merge publication.
● On the Specify Subscriber Types page, select the Devices running SQL Server CE check box.

By selecting Devices running Windows CE, the following options are automatically
configured for the publication:

● Support for anonymous subscriptions


● Character mode snapshot

If you use dynamic filters, SQL Server CE requires that you use the optimize
synchronization option. Set this option by using either the Create Publication Wizard or the
stored procedure sp_addmergepublication. For more information about this and other
SQL Server CE replication limitations, see Replication Limitations.

If this is the first publication created for this server, the Create Publication Wizard prompts
you to configure the snapshot folder location. The snapshot folder holds the snapshot files
that contain the schema and data for published tables. The SQL Server CE Replication
Provider must be able to read these snapshot files so it can download the files to the
Windows CE-based device.

Note The snapshot folder location defaults to an administrative


share (for example, C$); you should use an explicit share instead of
the default because the administrative share can be accessed only by
an administrator account. For more information, see Configuring an
Explicit Snapshot Folder.

See Also

Securing the Publication

Configuring the Snapshot Folder

Checking the Status of the Snapshot Agent

http://msdn.microsoft.com/library/default.asp?url=/...lce/htm/_lce_repl_impl_creating_the_publication.asp (1 of 2) [22/07/2004 08:02:41 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...lce/htm/_lce_repl_impl_creating_the_publication.asp (2 of 2) [22/07/2004 08:02:41 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Implementing Replication
Advanced Search

SQL Server CE Books Online

Securing the Publication


Securing the Microsoft® SQL Server™ publication involves the following steps:

Up One Level 1. Configuring Database Access

Configuring Database Access 2. Configuring the Publication Access List


3. Configuring the Check Permissions Option

Configuring the Publication Access List


Configuring the Check Permissions Option
See Also

Configuring Security for Connectivity

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...s/sqlce/htm/_lce_repl_impl_securing_the_publication.asp [22/07/2004 08:03:39 p.m.]


Configuring Database Access (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Securing the Publication

SQL Server CE Books Online

Configuring Database Access


When you create a publication, Microsoft® SQL Server™ creates a publication access list (PAL) for the publication. The PAL is similar to an access control list (ACL). To
add a user to the publication access list, you must first grant database access based on how you configured Microsoft Internet Information Services (IIS) and SQL
Server authentication.

To configure the Database Access option

1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing the publication, and Security; and then click Logins.
3. In the details pane, right-click the user ID under which the Merge Agent executes, and then click Properties. The user ID of the Merge Agent depends on how you configured IIS and SQL Server authentication.

IIS authentication mode SQL Server authentication mode Must grant database access to
Anonymous access Windows authentication computername\IUSR_computername or the configured IIS anonymous user account.

Basic authentication Windows authentication The IIS client's user or group.

Integrated Windows authentication Windows authentication The IIS client's user or group. (This configuration is supported only if SQL Server and IIS are running on the
same computer.)

Anonymous, Basic, or Integrated Windows authentication SQL Server authentication The user specified in the DistributorLogin or PublisherLogin property of the Replication object.

4. Click the Database Access tab, and then select the Permit check box for the database.

See Also

Configuring the Publication Access List

Configuring the Check Permissions Option

Configuring Security for Connectivity

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_configuring_database_access.asp?frame=true [22/07/2004 08:03:50 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Securing the Publication
MSDN Library Go
Advanced Search SQL Server CE Books Online

Configuring Database Access


When you create a publication, Microsoft® SQL Server™ creates a publication access list (PAL) for the publication. The PAL is similar to an access control list (ACL). To
add a user to the publication access list, you must first grant database access based on how you configured Microsoft Internet Information Services (IIS) and SQL
Server authentication.

Up One Level To configure the Database Access option

Configuring Database Access


Configuring the Publication Access List 1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing the publication, and Security; and then click Logins.

Configuring the Check Permissions Option 3. In the details pane, right-click the user ID under which the Merge Agent executes, and then click Properties. The user ID of the Merge Agent depends on how you configured IIS and SQL Server authentication.

IIS authentication mode SQL Server authentication mode Must grant database access to
Anonymous access Windows authentication computername\IUSR_computername or the configured IIS anonymous user account.

Basic authentication Windows authentication The IIS client's user or group.

Integrated Windows authentication Windows authentication The IIS client's user or group. (This configuration is supported only if SQL Server and IIS are running on the
same computer.)

Anonymous, Basic, or Integrated Windows authentication SQL Server authentication The user specified in the DistributorLogin or PublisherLogin property of the Replication object.

4. Click the Database Access tab, and then select the Permit check box for the database.

See Also

Configuring the Publication Access List

Configuring the Check Permissions Option

Configuring Security for Connectivity

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_configuring_database_access.asp [22/07/2004 08:04:18 p.m.]


Configuring the Publication Access List (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Securing the Publication

SQL Server CE Books Online

Configuring the Publication Access List


When you create a publication, Microsoft® SQL Server™ creates a publication access list (PAL) for the publication. The PAL is similar to an access control list (ACL). It
contains the list of logins that have been granted access to the publication. During synchronization, SQL Server checks the PAL for the Microsoft Internet Information
Services (IIS) user, in the case of Windows authentication, or the SQL Server login, in the case of SQL Server authentication.

By default, the PAL contains the members of the sysadmin fixed server role and the login of the user who created the publication. Expand or restrict access to a
publication by adding or deleting logins from the PAL. You must grant access to the publication based on how you configured IIS and SQL Server authentication.

To grant or revoke access to a publication

1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing your publication, Databases, and the database you are publishing, and then click Publications.
3. Right-click the publication name, click Properties, and then click the Publication Access List tab.
4. Use the Add or Remove buttons to add or delete logins from the PAL. You must add the user to SQL Server before you can add the user to the PAL. For more information, see "Adding a Windows NT User or Group" in SQL
Server Books Online.

IIS authentication mode SQL Server authentication mode The PAL must grant access to
Anonymous access Windows authentication computername\IUSR_computername or the configured IIS anonymous user account.

Basic authentication Windows authentication The IIS client's user or group.

Integrated Windows authentication Windows authentication The IIS client's user or group. (This configuration is only supported if SQL Server and IIS are running on the
same computer.)

Anonymous, Basic, or Integrated Windows authentication SQL Server authentication The users specified in the DistributorLogin and PublisherLogin properties of the Replication object.

Note If the Publisher and Distributor are on different computers, the new logins must exist in the PALs for both the Publisher and the
Distributor. If the IIS user, in the case of Windows authentication, or the SQL Server login, in the case of SQL Server authentication,
is not contained in the PAL, an Access Denied message is displayed at the Subscriber.

See Also

Configuring the Check Permissions Option

Configuring Database Access

Configuring Security for Connectivity

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_impl_publication_access_list.asp?frame=true [22/07/2004 08:04:33 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Securing the Publication
MSDN Library Go
Advanced Search SQL Server CE Books Online

Configuring the Publication Access List


When you create a publication, Microsoft® SQL Server™ creates a publication access list (PAL) for the publication. The PAL is similar to an access control list (ACL). It
contains the list of logins that have been granted access to the publication. During synchronization, SQL Server checks the PAL for the Microsoft Internet Information
Services (IIS) user, in the case of Windows authentication, or the SQL Server login, in the case of SQL Server authentication.

Up One Level By default, the PAL contains the members of the sysadmin fixed server role and the login of the user who created the publication. Expand or restrict access to a
publication by adding or deleting logins from the PAL. You must grant access to the publication based on how you configured IIS and SQL Server authentication.
Configuring Database Access
Configuring the Publication Access List
To grant or revoke access to a publication
Configuring the Check Permissions Option
1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing your publication, Databases, and the database you are publishing, and then click Publications.
3. Right-click the publication name, click Properties, and then click the Publication Access List tab.
4. Use the Add or Remove buttons to add or delete logins from the PAL. You must add the user to SQL Server before you can add the user to the PAL. For more information, see "Adding a Windows NT User or Group" in SQL
Server Books Online.

IIS authentication mode SQL Server authentication mode The PAL must grant access to
Anonymous access Windows authentication computername\IUSR_computername or the configured IIS anonymous user account.

Basic authentication Windows authentication The IIS client's user or group.

Integrated Windows authentication Windows authentication The IIS client's user or group. (This configuration is only supported if SQL Server and IIS are running on the
same computer.)

Anonymous, Basic, or Integrated Windows authentication SQL Server authentication The users specified in the DistributorLogin and PublisherLogin properties of the Replication object.

Note If the Publisher and Distributor are on different computers, the new logins must exist in the PALs for both the Publisher and the
Distributor. If the IIS user, in the case of Windows authentication, or the SQL Server login, in the case of SQL Server authentication,
is not contained in the PAL, an Access Denied message is displayed at the Subscriber.

See Also

Configuring the Check Permissions Option

Configuring Database Access

Configuring Security for Connectivity

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_impl_publication_access_list.asp (1 of 2) [22/07/2004 08:04:53 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_impl_publication_access_list.asp (2 of 2) [22/07/2004 08:04:53 p.m.]


Configuring the Check Permissions Option (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Securing the Publication

SQL Server CE Books Online

Configuring the Check Permissions Option


Use the Check Permissions option to provide an enhanced level of security to your publication. The Check Permissions option ensures that the Merge
Agent has the authority to upload data changes to a Publisher. When you specify this option, Microsoft® SQL Server™ verifies that the Merge Agent login
has the permissions to perform INSERT, UPDATE, and DELETE statements on the publication database.

Using Check Permissions is optional. When you specify Check Permissions, both Check Permissions validation and PAL verification are performed.

If you set the Check Permissions option after the initial snapshot has been generated, a new snapshot must be generated and reapplied at the
Subscriber for permissions to be validated when data changes are merged.

To configure the Check Permissions option

1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing your publication, Databases, and the database you are publishing; and then click Publications.
3. Right-click your publication name, click Properties, and then click the Articles tab.
4. Click the properties button (...) for the published article you want to configure. This displays the Table Article Properties dialog box.
5. Click the Merging Changes tab.
6. Under Check permissions, you can select the INSERT, UPDATE, and DELETE check boxes. When these boxes are selected, SQL Server verifies that the Merge Agent is running under a user identity that
has permission to insert, update, or delete data on the Publisher.

If you specify Check permissions, you must grant database access based on how you configured Microsoft Internet Information Services (IIS) and SQL
Server authentication. For more information, see Configuring Security for Connectivity.

See Also

Configuring Database Access

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_impl_check_permissions.asp?frame=true [22/07/2004 08:05:19 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Implementing Replication > Securing the Publication
Advanced Search

SQL Server CE Books Online

Configuring the Check


Permissions Option
Up One Level Use the Check Permissions option to provide an enhanced level of security to your
publication. The Check Permissions option ensures that the Merge Agent has the authority
Configuring Database Access to upload data changes to a Publisher. When you specify this option, Microsoft® SQL
Server™ verifies that the Merge Agent login has the permissions to perform INSERT,
Configuring the Publication Access List UPDATE, and DELETE statements on the publication database.

Configuring the Check Permissions Option


Using Check Permissions is optional. When you specify Check Permissions, both Check
Permissions validation and PAL verification are performed.

If you set the Check Permissions option after the initial snapshot has been generated, a
new snapshot must be generated and reapplied at the Subscriber for permissions to be
validated when data changes are merged.

To configure the Check Permissions option

1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to
Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing your
publication, Databases, and the database you are publishing; and then click Publications.
3. Right-click your publication name, click Properties, and then click the Articles tab.
4. Click the properties button (...) for the published article you want to configure. This displays the Table Article
Properties dialog box.
5. Click the Merging Changes tab.
6. Under Check permissions, you can select the INSERT, UPDATE, and DELETE check boxes. When these boxes
are selected, SQL Server verifies that the Merge Agent is running under a user identity that has permission to
insert, update, or delete data on the Publisher.

If you specify Check permissions, you must grant database access based on how you
configured Microsoft Internet Information Services (IIS) and SQL Server authentication. For
more information, see Configuring Security for Connectivity.

See Also

Configuring Database Access

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_impl_check_permissions.asp [22/07/2004 08:05:40 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Implementing Replication
Advanced Search

SQL Server CE Books Online

Configuring the Snapshot


Folder
Up One Level The snapshot folder holds the snapshot files containing the schema and data for published
tables. The SQL Server CE Replication Provider must be able to read these snapshot files to
Configuring the Default Snapshot Folder create the subscription on the Microsoft® Windows® CE-based device. You control access
to the snapshot folder by assigning file system access permissions to it.
Configuring an Explicit Snapshot Folder
When you assign Read permissions to the snapshot folder and share, remember that the
identity under which the SQL Server CE Replication Provider runs depends upon how
Microsoft Internet Information Services (IIS) authentication is configured:

● When IIS is configured to use Anonymous access, the SQL Server CE Replication Provider runs under the identity of
the default IIS anonymous user account (the Internet Guest Account: IUSR_computername). If you configure
another Windows user account as the IIS anonymous user account, the SQL Server CE Replication Provider runs
under the identity of that account.
● When IIS is configured to use Basic authentication, the SQL Server CE Replication Provider runs under the identity
of the Windows user account corresponding to the login and password supplied by the Subscriber for the
InternetLogin and InternetPassword properties of the Replication object.
● When IIS is configured to use Integrated Windows authentication, the SQL Server CE Replication Provider runs
under the identity of the Windows user account corresponding to the login and password supplied by the Subscriber
for the InternetLogin and InternetPassword properties of the Replication object. Unlike Basic authentication,
the login and password are never transmitted over the network with Integrated Windows authentication.

Whether IIS and the SQL Server Distributor are located on the same computer or different
computers, it is strongly recommended that you configure the snapshot folder as described
in Configuring an Explicit Snapshot Folder.

See Also

Configuring Security for Connectivity

InternetLogin Property (Replication)

InternetPassword Property (Replication)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr.../htm/_lce_repl_impl_configuring_the_snapshot_folder.asp [22/07/2004 08:06:20 p.m.]


Configuring the Default Snapshot Folder (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Configuring the Snapshot Folder

SQL Server CE Books Online

Configuring the Default Snapshot Folder


If the snapshot folder is located on a FAT file system, configuring the folder is not necessary; proceed directly to Checking the Status of the Snapshot Agent.

Note It is recommended that you use an NTFS file system because it is more secure.

The default snapshot folder, also called the normal snapshot folder, resides on an administrative share (drive$) by default. It is recommended that you do not use the
default administrative share setting but instead create an explicit share for the default (normal) snapshot folder. For more information, see Configuring an Explicit
Snapshot Folder.

To secure the snapshot folder

1. On the computer running Microsoft® SQL Server™, start Windows® Explorer by double-clicking My Computer.
2. Locate the snapshot folder, right-click it, and then click Properties. The default location of the snapshot folder is C$\Program Files\Microsoft SQL Server\Mssql\Repldata\Unc.
3. Click the Security tab. (If the Security tab is not displayed, you are using a FAT file system and can skip this step.) Set the NTFS file system directory permissions as follows.

User Required permissions


Always grant the SQL Server Service account and SQL Server Agent Service account Full Control. Full Control

For IIS Anonymous access, grant computername\IUSR_computername or the configured Microsoft Internet Information Services (IIS) anonymous user account read permission. If Read
IIS and the SQL Server Distributor are located on different computers, you must configure the IIS anonymous user account as a domain user account and grant that user read
access. The default anonymous user computername\IUSR_computername cannot be used because it is a local account.

For IIS Basic or Integrated Windows authentication, grant the client's user or group read permission. Read

See Also

Checking the Status of the Snapshot Agent

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...pl_configuring_a_local_snapshot_folder.asp?frame=true [22/07/2004 08:06:34 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Configuring the Snapshot Folder
MSDN Library Go
Advanced Search SQL Server CE Books Online

Configuring the Default Snapshot Folder


If the snapshot folder is located on a FAT file system, configuring the folder is not necessary; proceed directly to Checking the Status of the Snapshot Agent.

Note It is recommended that you use an NTFS file system because it is more secure.
Up One Level
Configuring the Default Snapshot Folder The default snapshot folder, also called the normal snapshot folder, resides on an administrative share (drive$) by default. It is recommended that you do not use the
Configuring an Explicit Snapshot Folder default administrative share setting but instead create an explicit share for the default (normal) snapshot folder. For more information, see Configuring an Explicit
Snapshot Folder.

To secure the snapshot folder

1. On the computer running Microsoft® SQL Server™, start Windows® Explorer by double-clicking My Computer.
2. Locate the snapshot folder, right-click it, and then click Properties. The default location of the snapshot folder is C$\Program Files\Microsoft SQL Server\Mssql\Repldata\Unc.
3. Click the Security tab. (If the Security tab is not displayed, you are using a FAT file system and can skip this step.) Set the NTFS file system directory permissions as follows.

User Required permissions


Always grant the SQL Server Service account and SQL Server Agent Service account Full Control. Full Control

For IIS Anonymous access, grant computername\IUSR_computername or the configured Microsoft Internet Information Services (IIS) anonymous user account read permission. If Read
IIS and the SQL Server Distributor are located on different computers, you must configure the IIS anonymous user account as a domain user account and grant that user read
access. The default anonymous user computername\IUSR_computername cannot be used because it is a local account.

For IIS Basic or Integrated Windows authentication, grant the client's user or group read permission. Read

See Also

Checking the Status of the Snapshot Agent

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_impl_configuring_a_local_snapshot_folder.asp [22/07/2004 08:06:37 p.m.]


Configuring an Explicit Snapshot Folder (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Configuring the Snapshot Folder

SQL Server CE Books Online

Configuring an Explicit Snapshot Folder


Explicitly configuring the snapshot folder and share is recommended. This is necessary because Microsoft® SQL Server™ places the snapshot folder in the C$ share by
default. The C$ share is a special administrative-only share. You cannot grant rights to the C$ share, and only administrators on the computer can access it. You must
create and secure a nonadministrative network share for the snapshot folder so the Server SQL Server CE Replication Provider can read it remotely.

If you have already configured the Distributor using the administrative share, you must also change the location of the default snapshot folder after the new explicit
share is created.

To create and secure a nonadministrative network share

1. On the computer running SQL Server, start Microsoft Windows® Explorer by double-clicking My Computer. Create a new NTFS file system folder to contain the snapshot files. Place the folder on any drive you want and give
it any name you want.
2. Right-click the new folder, click Properties, and then click the Sharing tab.
3. Click Share this folder. In Share name, type any name you want. Optionally enter a comment describing the share.
4. To display the Share Permissions tab, click Permissions. Click the Add button to grant the following permissions to the share.

User Required permissions


Always grant the SQL Server Service account and SQL Server Agent Service account Full Control. Full Control

For IIS Anonymous access, you must configure the IIS anonymous user account as a domain user account and grant that user read permission. The default anonymous user Read
computername\IUSR_computername cannot be used because it is a local account.

For IIS Basic or Integrated Windows authentication, grant the client's user or group read permission. Read

5. To close the Share Permissions tab, click OK.


6. Click the Security tab. (If the Security tab is not displayed, you are using a FAT file system and can skip this step.) Set the same NTFS permissions as the permissions specified on the actual folder in Step 4, and then click
OK to close.

To change the location of the default snapshot folder

1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, and select the instance of SQL Server containing the publication.
3. With the appropriate instance of SQL Server selected, on the Tools menu, point to Replication, and then click Configuring Publishing, Subscribers, and Distribution.
4. Select the Publisher tab, and then click the properties (...) button.
5. Enter the new folder location where the snapshot files will be stored. This location is the new nonadministrative network share you just created.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...l_configuring_a_remote_snapshot_folder.asp?frame=true [22/07/2004 08:06:42 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication > Configuring the Snapshot Folder
MSDN Library Go
Advanced Search SQL Server CE Books Online

Configuring an Explicit Snapshot Folder


Explicitly configuring the snapshot folder and share is recommended. This is necessary because Microsoft® SQL Server™ places the snapshot folder in the C$ share by
default. The C$ share is a special administrative-only share. You cannot grant rights to the C$ share, and only administrators on the computer can access it. You must
create and secure a nonadministrative network share for the snapshot folder so the Server SQL Server CE Replication Provider can read it remotely.

Up One Level If you have already configured the Distributor using the administrative share, you must also change the location of the default snapshot folder after the new explicit
share is created.
Configuring the Default Snapshot Folder
Configuring an Explicit Snapshot Folder
To create and secure a nonadministrative network share

1. On the computer running SQL Server, start Microsoft Windows® Explorer by double-clicking My Computer. Create a new NTFS file system folder to contain the snapshot files. Place the folder on any drive you want and give
it any name you want.
2. Right-click the new folder, click Properties, and then click the Sharing tab.
3. Click Share this folder. In Share name, type any name you want. Optionally enter a comment describing the share.
4. To display the Share Permissions tab, click Permissions. Click the Add button to grant the following permissions to the share.

User Required permissions


Always grant the SQL Server Service account and SQL Server Agent Service account Full Control. Full Control

For IIS Anonymous access, you must configure the IIS anonymous user account as a domain user account and grant that user read permission. The default anonymous user Read
computername\IUSR_computername cannot be used because it is a local account.

For IIS Basic or Integrated Windows authentication, grant the client's user or group read permission. Read

5. To close the Share Permissions tab, click OK.


6. Click the Security tab. (If the Security tab is not displayed, you are using a FAT file system and can skip this step.) Set the same NTFS permissions as the permissions specified on the actual folder in Step 4, and then click
OK to close.

To change the location of the default snapshot folder

1. On the computer running SQL Server, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, and select the instance of SQL Server containing the publication.
3. With the appropriate instance of SQL Server selected, on the Tools menu, point to Replication, and then click Configuring Publishing, Subscribers, and Distribution.
4. Select the Publisher tab, and then click the properties (...) button.
5. Enter the new folder location where the snapshot files will be stored. This location is the new nonadministrative network share you just created.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_impl_configuring_a_remote_snapshot_folder.asp [22/07/2004 08:06:45 p.m.]


Checking the Status of the Snapshot Agent (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Implementing Replication

SQL Server CE Books Online

Checking the Status of the Snapshot Agent


You can use the Replication Monitor in SQL Server Enterprise Manager to check the status of the Snapshot Agent and ensure that the snapshot has been
created.

To check the status of the Snapshot Agent

1. On the computer running Microsoft® SQL Server™, start SQL Server Enterprise Manager: On the Start menu, point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing the Distributor for the publication, and Replication Monitor; and then click Agents.
3. In the left pane, click Snapshot Agents. The status of the Snapshot Agent is displayed in the right pane.
4. To display more information about an entry listed in the right pane, double-click the entry.

If the Snapshot Agent for the publication has not started, in the right pane, right-click the agent entry and select Start Agent.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lc...cking_the_status_of_the_snapshot_agent.asp?frame=true [22/07/2004 08:07:06 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Implementing Replication
Advanced Search

SQL Server CE Books Online

Checking the Status of the


Snapshot Agent
Up One Level You can use the Replication Monitor in SQL Server Enterprise Manager to check the status of
the Snapshot Agent and ensure that the snapshot has been created.
Creating the Publication
Securing the Publication To check the status of the Snapshot Agent
Configuring the Snapshot Folder
Checking the Status of the Snapshot Agent 1. On the computer running Microsoft® SQL Server™, start SQL Server Enterprise Manager: On the Start menu,
point to Programs, Microsoft SQL Server, and then click Enterprise Manager.
2. In the console tree, expand Microsoft SQL Servers, SQL Server Group, the computer containing the Distributor
for the publication, and Replication Monitor; and then click Agents.
3. In the left pane, click Snapshot Agents. The status of the Snapshot Agent is displayed in the right pane.
4. To display more information about an entry listed in the right pane, double-click the entry.

If the Snapshot Agent for the publication has not started, in the right pane, right-click the
agent entry and select Start Agent.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/li...pl_impl_checking_the_status_of_the_snapshot_agent.asp [22/07/2004 08:07:38 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication
Advanced Search

SQL Server CE Books Online


Planning for Replication

The following topics in this section provide information to consider before implementing
replication in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Typical
SQL Server CE replication topologies are described. Information regarding what data can be
replicated and limitations on published data is also provided.
Up One Level
Replication Topologies ● Replication Topologies
Supported Data Types and Data Type Mappings
Supported Data Types and Data Type Mappings

● Replication Limitations
Schema Changes on Publication Databases
Replication Limitations

● Replication Conflict Detection and Resolution

Schema Changes on Publication Databases


Replication Conflict Detection and Resolution

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/libr...s/sqlce/htm/_lce_repl_plan_planning_for_replication.asp [22/07/2004 08:07:53 p.m.]


Replication Topologies (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Planning for Replication

SQL Server CE Books Online

Replication Topologies
You can configure replication in Microsoft® SQL Server™ 2000 Windows CE Edition (SQL Server CE) in a variety of ways. You should choose a
configuration based on the following factors:

● Performance

The performance of a system depends on the number of Microsoft Windows CE-based devices that must be supported, the frequency with which the devices must synchronize with the server, the
connection bandwidth, the timeframe during which synchronization must occur, and the load that each device imposes on the server while synchronizing.

● Security

The configuration you choose is influenced by the security requirements of the application you develop.

Basic Configuration Rules

The following basic configuration rules govern SQL Server CE replication configuration:

● The Subscriber is always an anonymous Subscriber.

Individual Subscribers cannot be assigned a merge replication conflict resolution priority; the priority for Subscribers is always 0.

● SQL Server CE cannot be a Publisher or Distributor.

Two or more Windows CE-based devices can share a publication only by subscribing to the same SQL Server 2000 publication.

● A Subscriber must always synchronize with the same Publisher.

Synchronizing with alternate synchronization partners is not supported.

Topologies

You can choose from a variety of SQL Server CE replication topologies. The more common ways to configure SQL Server CE replication are:

● Single server
● Two servers
● Multiple Microsoft Internet Information Services (IIS) systems and SQL Server republishing

Single Server

In the simplest SQL Server CE replication topology, IIS, the SQL Server Publisher, and the SQL Server Distributor all reside on a single server. SQL Server
CE Subscribers, running on Windows CE-based devices, synchronize by connecting to IIS on the Publisher. The Publisher can be located behind a firewall.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_plan_replication_topologies_.asp?frame=true (1 of 5) [22/07/2004 08:07:57 p.m.]


Replication Topologies (SQL Server CE Books Online)

Two Servers

You can place IIS on one server and configure the SQL Server Publisher and Distributor on another server. The server running IIS can be isolated from the
Internet by a firewall. SQL Server CE clients, running on Windows CE-based devices, synchronize by connecting to IIS. Another firewall can isolate the SQL
Server Publisher and Distributor from the IIS system.

Multiple IIS Systems and SQL Server Republishing

If you must support very large numbers of SQL Server CE Subscribers that synchronize at the same time, you can partition the work across multiple
computers running IIS.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_plan_replication_topologies_.asp?frame=true (2 of 5) [22/07/2004 08:07:57 p.m.]


Replication Topologies (SQL Server CE Books Online)

If further load balancing is required on the computer running SQL Server, you can create a republishing hierarchy on multiple computers. The top-level
Publisher publishes data to Subscribers, which in turn republish the data, load balancing requests from the SQL Server CE clients. Load balancing is static
in the sense that each SQL Server CE Subscriber is assigned to one of the republishers and always synchronizes with that republisher (SQL Server CE does
not support alternate synchronization partners).

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_plan_replication_topologies_.asp?frame=true (3 of 5) [22/07/2004 08:07:57 p.m.]


Replication Topologies (SQL Server CE Books Online)

By using Microsoft ActiveSync®, a desktop system may be used to synchronize SQL Server CE to an instance of SQL Server. By using Microsoft Windows
Powered Pocket PC 2002 and Microsoft ActiveSync 3.5, you can use the Pass Through functionality. If you are using ActiveSync 3.1, you must install SQL
Server CE Relay. For more information, see Using SQL Server CE Relay.

Using Windows Clustering

SQL Server CE replication can be used on a Microsoft Windows 2000 cluster containing a farm of Web servers running IIS. However, the SQL Server CE
Server Agent must maintain session state across client calls; therefore, you must use load-balancing hardware or software that is capable of maintaining a
session state between the SQL Server CE Client Agent and the SQL Server CE Server Agent.

Load-balancing systems typically work as follows: Clients access the cluster using a common domain name with a single virtual IP address; the load-
balancing hardware or software intercepts the incoming HTTP traffic and directs it to one of the servers in the cluster.

SQL Server CE can be used with a variety of load-balancing systems for example Windows 2000 Network Load Balancing (NLB).

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_plan_replication_topologies_.asp?frame=true (4 of 5) [22/07/2004 08:07:57 p.m.]


Replication Topologies (SQL Server CE Books Online)

Windows 2000 NLB is included as part of Microsoft Windows 2000 Advanced Server and Windows 2000 Datacenter Server. NLB can be used with SQL
Server CE because NLB supports client affinity, which is an option that ensures that the client is always directed to the same server running IIS within the
cluster. Note, however, that if a server or network failure occurs during a client session, a new logon is required to reauthenticate the client and
reestablish session state. Also, adding a new server running IIS to the cluster redirects some client traffic to the new server, which can affect existing
sessions.

For more information, see "Windows Clustering Technologies" in the technical resources for Microsoft Windows 2000 at this Microsoft Web site.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_repl_plan_replication_topologies_.asp?frame=true (5 of 5) [22/07/2004 08:07:57 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server
MSDN Library Go 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using
Replication > Planning for Replication
Advanced Search

SQL Server CE Books Online

Replication Topologies
You can configure replication in Microsoft® SQL Server™ 2000 Windows CE Edition (SQL Server CE) in a variety of
ways. You should choose a configuration based on the following factors:

Up One Level
Replication Topologies ● Performance

Supported Data Types and Data Type Mappings The performance of a system depends on the number of Microsoft Windows CE-based devices that must be supported, the frequency with which the

Replication Limitations
devices must synchronize with the server, the connection bandwidth, the timeframe during which synchronization must occur, and the load that
each device imposes on the server while synchronizing.

Schema Changes on Publication Databases


● Security

Replication Conflict Detection and Resolution The configuration you choose is influenced by the security requirements of the application you develop.

Basic Configuration Rules

The following basic configuration rules govern SQL Server CE replication configuration:

● The Subscriber is always an anonymous Subscriber.

Individual Subscribers cannot be assigned a merge replication conflict resolution priority; the priority for Subscribers is always 0.

● SQL Server CE cannot be a Publisher or Distributor.

Two or more Windows CE-based devices can share a publication only by subscribing to the same SQL Server 2000 publication.

● A Subscriber must always synchronize with the same Publisher.

Synchronizing with alternate synchronization partners is not supported.

Topologies

You can choose from a variety of SQL Server CE replication topologies. The more common ways to configure SQL
Server CE replication are:

● Single server
● Two servers
● Multiple Microsoft Internet Information Services (IIS) systems and SQL Server republishing

Single Server

In the simplest SQL Server CE replication topology, IIS, the SQL Server Publisher, and the SQL Server Distributor
all reside on a single server. SQL Server CE Subscribers, running on Windows CE-based devices, synchronize by
connecting to IIS on the Publisher. The Publisher can be located behind a firewall.

http://msdn.microsoft.com/library/default.asp?url=/...qlce/htm/_lce_repl_plan_replication_topologies_.asp (1 of 5) [22/07/2004 08:08:00 p.m.]


Welcome to the MSDN Library

Two Servers

You can place IIS on one server and configure the SQL Server Publisher and Distributor on another server. The
server running IIS can be isolated from the Internet by a firewall. SQL Server CE clients, running on Windows CE-
based devices, synchronize by connecting to IIS. Another firewall can isolate the SQL Server Publisher and
Distributor from the IIS system.

Multiple IIS Systems and SQL Server Republishing

If you must support very large numbers of SQL Server CE Subscribers that synchronize at the same time, you can
partition the work across multiple computers running IIS.

http://msdn.microsoft.com/library/default.asp?url=/...qlce/htm/_lce_repl_plan_replication_topologies_.asp (2 of 5) [22/07/2004 08:08:00 p.m.]


Welcome to the MSDN Library

If further load balancing is required on the computer running SQL Server, you can create a republishing hierarchy
on multiple computers. The top-level Publisher publishes data to Subscribers, which in turn republish the data, load
balancing requests from the SQL Server CE clients. Load balancing is static in the sense that each SQL Server CE
Subscriber is assigned to one of the republishers and always synchronizes with that republisher (SQL Server CE
does not support alternate synchronization partners).

http://msdn.microsoft.com/library/default.asp?url=/...qlce/htm/_lce_repl_plan_replication_topologies_.asp (3 of 5) [22/07/2004 08:08:00 p.m.]


Welcome to the MSDN Library

By using Microsoft ActiveSync®, a desktop system may be used to synchronize SQL Server CE to an instance of
SQL Server. By using Microsoft Windows Powered Pocket PC 2002 and Microsoft ActiveSync 3.5, you can use the
Pass Through functionality. If you are using ActiveSync 3.1, you must install SQL Server CE Relay. For more
information, see Using SQL Server CE Relay.

Using Windows Clustering

SQL Server CE replication can be used on a Microsoft Windows 2000 cluster containing a farm of Web servers
running IIS. However, the SQL Server CE Server Agent must maintain session state across client calls; therefore,
you must use load-balancing hardware or software that is capable of maintaining a session state between the SQL
Server CE Client Agent and the SQL Server CE Server Agent.

Load-balancing systems typically work as follows: Clients access the cluster using a common domain name with a
single virtual IP address; the load-balancing hardware or software intercepts the incoming HTTP traffic and directs
it to one of the servers in the cluster.

SQL Server CE can be used with a variety of load-balancing systems for example Windows 2000 Network Load
Balancing (NLB).

Windows 2000 NLB is included as part of Microsoft Windows 2000 Advanced Server and Windows 2000 Datacenter
Server. NLB can be used with SQL Server CE because NLB supports client affinity, which is an option that ensures
that the client is always directed to the same server running IIS within the cluster. Note, however, that if a server
or network failure occurs during a client session, a new logon is required to reauthenticate the client and
reestablish session state. Also, adding a new server running IIS to the cluster redirects some client traffic to the
new server, which can affect existing sessions.

For more information, see "Windows Clustering Technologies" in the technical resources for Microsoft Windows
2000 at this Microsoft Web site.

http://msdn.microsoft.com/library/default.asp?url=/...qlce/htm/_lce_repl_plan_replication_topologies_.asp (4 of 5) [22/07/2004 08:08:00 p.m.]


Welcome to the MSDN Library

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...qlce/htm/_lce_repl_plan_replication_topologies_.asp (5 of 5) [22/07/2004 08:08:00 p.m.]


Supported Data Types and Data Type Mappings (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Planning for Replication

SQL Server CE Books Online

Supported Data Types and Data Type Mappings


The following table shows the data type mappings that are performed when replicating between Microsoft® SQL Server™ and Microsoft SQL Server 2000
Windows® CE Edition (SQL Server CE). The table lists mappings for each SQL Server data type and describes restrictions or special behaviors.

SQL Server data type SQL Server CE data type


bigint (int 8) bigint (int 8)

binary (n) binary (n) or image


If the length of the data is 510 bytes or less, SQL Server CE replication maps the SQL Server binary data to SQL Server CE binary; otherwise, it maps it to SQL
Server CE image.
If the length of the image data exceeds the length of the binary column, synchronization fails when the data is sent from the SQL Server CE Subscriber to the SQL
Server Publisher.

bit bit

character national character or ntext


(synonym: If the length of the data is 255 characters or less, SQL Server CE replication maps the SQL Server character data to SQL Server CE national character ;
char) otherwise, it maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the character column, synchronization fails when the data is sent from the SQL Server CE subscription to the
SQL Server publication.

character varying national character varying or ntext


(synonyms: If the length of the data is 255 characters or less, SQL Server CE replication maps the SQL Server character varying data to SQL Server CE national character
char varying, varying; otherwise, it maps it to SQL Server CE ntext .
varchar) If the length of the ntext data exceeds the length of the character varying column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

datetime datetime

decimal See numeric.

double precision double precision

float float

image image

integer (int 4) integer (int 4)


(synonym:
int)

money money

national character national character


(synonyms: If the length of the data is 255 characters or less, SQL Server CE replication maps the SQL Server national character data to SQL Server CE national character;
national char, otherwise, it maps it to SQL Server CE ntext.
nchar) If the length of the ntext data exceeds the length of the national character column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

national character varying national character varying


(synonyms: If the length of the data is 255 characters or less; SQL Server CE replication maps the SQL Server national character varying data to SQL Server CE national
national char varying, nvarchar) character varying; otherwise, it maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the national character varying column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

ntext ntext

numeric numeric
(synonyms:
decimal, dec)

real real

smalldatetime datetime
If the precision of the datetime data exceeds the precision of the smalldatetime column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

smallint (int 2) smallint (int 2)

smallmoney money
If the precision of the money data exceeds the precision of the smallmoney column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

sql_variant sql_variant is mapped to ntext.


If binary data exists in the sql_variant column, the binary data must be an even number of bytes or a conversion error occurs.

text ntext
If the length of the text data exceeds 1,073,741,823 characters, synchronization fails when the data is sent from the SQL Server publication to the SQL Server CE
subscription.

timestamp Not supported


Data stored as timestamp data is vertically partitioned out of all SQL Server CE Subscriptions.

tinyint (int 1) tinyint (int 1)

uniqueidentifier uniqueidentifier

varbinary (n) varbinary (n) or image


If the length of the data is 510 bytes or less, SQL Server CE replication maps the SQL Server varbinary data to SQL Server CE varbinary ; otherwise, it maps it to
SQL Server CE image.
If the length of the image data exceeds the length of the varbinary column, synchronization fails when the data is sent from the SQL Server CE subscription to the
SQL Server publication.

varchar See character varying

Choose data types that are supported by both SQL Server and SQL Server CE, so it is not necessary for replication to perform data mapping. When this is not
possible, the application should validate the values stored in SQL Server CE to ensure that replication can map these values between SQL Server and SQL Server
CE.

You cannot publish a table having an index on char, nchar, varchar, or nvarchar columns with lengths greater than 255. Creation of the SQL Server CE
subscription fails because these column types are mapped to ntext, and a primary key cannot be created on an ntext column.

http://msdn.microsoft.com/library/en-us/sqlce/htm...blishing_data_and_database_objects.asp?frame=true (1 of 2) [22/07/2004 08:08:15 p.m.]


Supported Data Types and Data Type Mappings (SQL Server CE Books Online)

For more information about SQL Server data types, see "Data Types" in SQL Server Books Online.

See Also

Replication Limitations

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm...blishing_data_and_database_objects.asp?frame=true (2 of 2) [22/07/2004 08:08:15 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Planning for Replication
MSDN Library Go
Advanced Search SQL Server CE Books Online

Supported Data Types and Data Type Mappings


The following table shows the data type mappings that are performed when replicating between Microsoft® SQL Server™ and Microsoft SQL Server 2000
Windows® CE Edition (SQL Server CE). The table lists mappings for each SQL Server data type and describes restrictions or special behaviors.

Up One Level SQL Server data type SQL Server CE data type

Replication Topologies bigint (int 8) bigint (int 8)

binary (n) binary (n) or image

Supported Data Types and Data Type Mappings If the length of the data is 510 bytes or less, SQL Server CE replication maps the SQL Server binary data to SQL Server CE binary; otherwise, it maps it to SQL
Server CE image.
If the length of the image data exceeds the length of the binary column, synchronization fails when the data is sent from the SQL Server CE Subscriber to the SQL
Replication Limitations Server Publisher.

bit bit
Schema Changes on Publication Databases character national character or ntext

Replication Conflict Detection and Resolution


(synonym: If the length of the data is 255 characters or less, SQL Server CE replication maps the SQL Server character data to SQL Server CE national character ;
char) otherwise, it maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the character column, synchronization fails when the data is sent from the SQL Server CE subscription to the
SQL Server publication.

character varying national character varying or ntext


(synonyms: If the length of the data is 255 characters or less, SQL Server CE replication maps the SQL Server character varying data to SQL Server CE national character
char varying, varying; otherwise, it maps it to SQL Server CE ntext .
varchar) If the length of the ntext data exceeds the length of the character varying column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

datetime datetime

decimal See numeric.

double precision double precision

float float

image image

integer (int 4) integer (int 4)


(synonym:
int)

money money

national character national character


(synonyms: If the length of the data is 255 characters or less, SQL Server CE replication maps the SQL Server national character data to SQL Server CE national character;
national char, otherwise, it maps it to SQL Server CE ntext.
nchar) If the length of the ntext data exceeds the length of the national character column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

national character varying national character varying


(synonyms: If the length of the data is 255 characters or less; SQL Server CE replication maps the SQL Server national character varying data to SQL Server CE national
national char varying, nvarchar) character varying; otherwise, it maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the national character varying column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

ntext ntext

numeric numeric
(synonyms:
decimal, dec)

real real

smalldatetime datetime
If the precision of the datetime data exceeds the precision of the smalldatetime column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

smallint (int 2) smallint (int 2)

smallmoney money
If the precision of the money data exceeds the precision of the smallmoney column, synchronization fails when the data is sent from the SQL Server CE
subscription to the SQL Server publication.

sql_variant sql_variant is mapped to ntext.


If binary data exists in the sql_variant column, the binary data must be an even number of bytes or a conversion error occurs.

text ntext
If the length of the text data exceeds 1,073,741,823 characters, synchronization fails when the data is sent from the SQL Server publication to the SQL Server CE
subscription.

timestamp Not supported


Data stored as timestamp data is vertically partitioned out of all SQL Server CE Subscriptions.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_plan_publishing_data_and_database_objects.asp (1 of 2) [22/07/2004 08:08:18 p.m.]


Welcome to the MSDN Library
tinyint (int 1) tinyint (int 1)

uniqueidentifier uniqueidentifier

varbinary (n) varbinary (n) or image


If the length of the data is 510 bytes or less, SQL Server CE replication maps the SQL Server varbinary data to SQL Server CE varbinary ; otherwise, it maps it to
SQL Server CE image.
If the length of the image data exceeds the length of the varbinary column, synchronization fails when the data is sent from the SQL Server CE subscription to the
SQL Server publication.

varchar See character varying

Choose data types that are supported by both SQL Server and SQL Server CE, so it is not necessary for replication to perform data mapping. When this is not
possible, the application should validate the values stored in SQL Server CE to ensure that replication can map these values between SQL Server and SQL Server
CE.

You cannot publish a table having an index on char, nchar, varchar, or nvarchar columns with lengths greater than 255. Creation of the SQL Server CE
subscription fails because these column types are mapped to ntext, and a primary key cannot be created on an ntext column.

For more information about SQL Server data types, see "Data Types" in SQL Server Books Online.

See Also

Replication Limitations

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_repl_plan_publishing_data_and_database_objects.asp (2 of 2) [22/07/2004 08:08:18 p.m.]


Replication Limitations (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Planning for Replication

SQL Server CE Books Online

Replication Limitations
Replication in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has the following limitations:

● Dynamic filters

When you use dynamic filters, SQL Server CE requires that you use the optimize synchronization option. You can set this option by using either the Create Publication wizard or stored procedure scripts:

● Using the Create Publication wizard

Select Yes, minimize the amount of data to minimize the amount of data sent over the network when dynamic horizontal filters are defined. You cannot change this option for an existing publication.

● Using the sp_addmergepublication script

Set the @keep_partition_changes option to TRUE. The @keep_partition_changes option specifies whether synchronization optimization occurs.

For more information, see the topics "Optimizing Synchronization" and "sp_addmergepublication" in SQL Server Books Online.

Additionally, SQL Server CE cannot validate Subscriber information. When configuring a Publication with dynamic filters, you can request that the Subscriber information be validated; however, SQL Server
CE ignores this request.

Note The HostName property specifies the dynamic filter value for the subscription. If you want to change the dynamic filter value for the Subscriber by specifying a new
HostName property, you must call the Reinitialize method before you synchronize.

● Display of Subscriber names in SQL Server Enterprise Manager

For SQL Server CE Subscribers listed in the SQL Server Enterprise Manager Replication Monitor, the Merge Agent subscription column is formatted as subscribername:-agentid. This guarantees uniqueness
for each row in the Merge Agent if the Subscriber name supplied by the SQL Server CE application is not unique across all SQL Server CE subscriptions. The Subscriber name and the agent ID can be used
to find the Subscriber ID (GUID) in the msmerge_agents system table in the distribution database.

● Connection timeout

SQL Server CE connectivity solutions recover from communication failures by restarting from the last successfully transmitted block of data, as long as the connection recovers within a time-out period of
approximately two minutes. This makes synchronization possible even if the underlying transport is not reliable.

● Snapshots

SQL Server CE only supports the alternate snapshot location option, if the usual (default) snapshot location is not available.

To specify an alternate snapshot location, you can set this option by using either the create publication stored procedure script or by using SQL Server Enterprise Manager to edit the properties of an
existing publication:

● Using the sp_addmergepublication script

Set the @snapshot_in_defaultfolder option to FALSE and @alt_snapshot_folder= location of the alternate folder for the snapshot.

● Editing Publication Properties of an existing publication

On the Snapshot Location tab of the publications Properties dialog box, clear the Generate snapshots in the normal snapshot folder check box, select Generate snapshots in the following
location check box, and specify the new location in Folder. You cannot change this option for an existing publication.

Note SQL Server CE does not support FTP or compressed snapshot options for either the default or alternate locations.

● Ranged identity columns

SQL Server CE identity columns must have a data type of integer (int 4). SQL Server CE identity columns cannot have a data type of bigint, smallint, tinyint, decimal, or numeric. If you subscribe to
a publication having an identity column other than integer (int 4), the creation of that subscription fails on SQL Server CE.

SQL Server CE allows you to modify the seed and increment values at the Subscriber by using the ALTER TABLE table_name ALTER COLUMN column_name IDENTITY (seed,increment) statement. This
allows you to manage identity ranges manually, if you want. However, if your publication includes an identity column and the AutoIdentityRange property at the Publisher is TRUE, you should not modify
the seed or increment values at the Subscriber. If you specify a seed that is above your allocated range identity, SQL Server CE returns an error when you attempt to insert a new record in the table. When
you next synchronize, the Publisher corrects the problem by assigning your Subscriber a new identity range.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_limitations_on_published_data.asp?frame=true (1 of 2) [22/07/2004 08:08:58 p.m.]


Replication Limitations (SQL Server CE Books Online)

● Computed columns

Not supported. Data stored as computed columns is vertically partitioned out of all SQL Server CE subscriptions.

● Information that is not propagated to the SQL Server CE Subscriber

You can include the following items in a SQL Server publication, but they are not propagated to the SQL Server CE Subscriber:

● CHECK constraints
● DEFAULT definitions for columns
● Extended properties
● Stored procedures
● Views
● User-defined functions
● Triggers

Because SQL Server CE replication cannot propagate these items, you should implement equivalent logic in a SQL Server CE-based application. Doing so ensures that the SQL Server CE database remains
consistent with the SQL Server database. For example, if the SQL Server database includes a CHECK constraint, the SQL Server CE-based application should implement the corresponding check in
application code.

● Case sensitivity

SQL Server CE databases are not case-sensitive; therefore objects and data are treated differently in a SQL Server CE database from the way in which they are treated in a SQL Server database. For
example, two tables, MYTABLE and mytable, are treated as different objects in a case-sensitive SQL Server database. The same table names cause a naming conflict in a SQL Server CE database.
Similarly, two values, MYVALUE and myvalue, cause a primary key violation in SQL Server CE, because they are treated as the same value, whereas they do not cause a violation in a case-sensitive SQL
Server database.

● UNIQUE constraints

SQL Server and SQL Server CE differ slightly in the way they implement UNIQUE constraints. SQL Server allows a single NULL value in a column with a UNIQUE constraint; SQL Server CE does not allow a
NULL value in this case. If you subscribe to a publication that contains a NULL value in a column with a UNIQUE constraint, the creation of that subscription fails on SQL Server CE.

● Tables and columns

For all replication tables, the number of available columns is 252 (255 – 3 system columns). SQL Server CE allocates three system columns for tracking.

● NOT FOR REPLICATION constraints

SQL Server CE does not support the NOT FOR REPLICATION option. Do not create constraints using this option. If constraints in a database have the NOT FOR REPLICATION option, remove the constraint
and then re-create it. If the NOT FOR REPLICATION option is specified, the constraint is still created on the SQL Server CE Subscriber, but it does not include the NOT FOR REPLICATION syntax.

See Also

IDENTITY (Property)

Supported Data Types and Data Type Mappings

ReinitializeSubscription Method

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter


©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_limitations_on_published_data.asp?frame=true (2 of 2) [22/07/2004 08:08:58 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Planning for Replication
Advanced Search

SQL Server CE Books Online

Replication Limitations
Replication in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has the
following limitations:

Up One Level
Replication Topologies ● Dynamic filters

Supported Data Types and Data Type Mappings When you use dynamic filters, SQL Server CE requires that you use the optimize synchronization option. You can

Replication Limitations
set this option by using either the Create Publication wizard or stored procedure scripts:

● Using the Create Publication wizard

Schema Changes on Publication Databases


Replication Conflict Detection and Resolution Select Yes, minimize the amount of data to minimize the amount of data sent over the network when dynamic
horizontal filters are defined. You cannot change this option for an existing publication.

● Using the sp_addmergepublication script

Set the @keep_partition_changes option to TRUE. The @keep_partition_changes option specifies whether
synchronization optimization occurs.

For more information, see the topics "Optimizing Synchronization" and "sp_addmergepublication" in SQL Server
Books Online.

Additionally, SQL Server CE cannot validate Subscriber information. When configuring a Publication with dynamic
filters, you can request that the Subscriber information be validated; however, SQL Server CE ignores this request.

Note The HostName property specifies the dynamic filter value for the
subscription. If you want to change the dynamic filter value for the Subscriber by
specifying a new HostName property, you must call the Reinitialize method
before you synchronize.

● Display of Subscriber names in SQL Server Enterprise Manager

For SQL Server CE Subscribers listed in the SQL Server Enterprise Manager Replication Monitor, the Merge Agent
subscription column is formatted as subscribername:-agentid. This guarantees uniqueness for each row in the
Merge Agent if the Subscriber name supplied by the SQL Server CE application is not unique across all SQL Server
CE subscriptions. The Subscriber name and the agent ID can be used to find the Subscriber ID (GUID) in the
msmerge_agents system table in the distribution database.

● Connection timeout

SQL Server CE connectivity solutions recover from communication failures by restarting from the last successfully
transmitted block of data, as long as the connection recovers within a time-out period of approximately two
minutes. This makes synchronization possible even if the underlying transport is not reliable.

● Snapshots

SQL Server CE only supports the alternate snapshot location option, if the usual (default) snapshot location is not
available.

To specify an alternate snapshot location, you can set this option by using either the create publication stored
procedure script or by using SQL Server Enterprise Manager to edit the properties of an existing publication:

● Using the sp_addmergepublication script

Set the @snapshot_in_defaultfolder option to FALSE and @alt_snapshot_folder= location of the alternate
folder for the snapshot.

● Editing Publication Properties of an existing publication

On the Snapshot Location tab of the publications Properties dialog box, clear the Generate snapshots in the
normal snapshot folder check box, select Generate snapshots in the following location check box, and
specify the new location in Folder. You cannot change this option for an existing publication.

Note SQL Server CE does not support FTP or compressed snapshot options for
either the default or alternate locations.

● Ranged identity columns

http://msdn.microsoft.com/library/default.asp?url=/...us/sqlce/htm/_lce_limitations_on_published_data.asp (1 of 2) [22/07/2004 08:09:01 p.m.]


Welcome to the MSDN Library

SQL Server CE identity columns must have a data type of integer (int 4). SQL Server CE identity columns cannot
have a data type of bigint, smallint, tinyint, decimal, or numeric. If you subscribe to a publication having an
identity column other than integer (int 4), the creation of that subscription fails on SQL Server CE.

SQL Server CE allows you to modify the seed and increment values at the Subscriber by using the ALTER TABLE
table_name ALTER COLUMN column_name IDENTITY (seed,increment) statement. This allows you to manage
identity ranges manually, if you want. However, if your publication includes an identity column and the
AutoIdentityRange property at the Publisher is TRUE, you should not modify the seed or increment values at the
Subscriber. If you specify a seed that is above your allocated range identity, SQL Server CE returns an error when
you attempt to insert a new record in the table. When you next synchronize, the Publisher corrects the problem by
assigning your Subscriber a new identity range.

● Computed columns

Not supported. Data stored as computed columns is vertically partitioned out of all SQL Server CE subscriptions.

● Information that is not propagated to the SQL Server CE Subscriber

You can include the following items in a SQL Server publication, but they are not propagated to the SQL Server CE
Subscriber:

● CHECK constraints
● DEFAULT definitions for columns
● Extended properties
● Stored procedures
● Views
● User-defined functions
● Triggers

Because SQL Server CE replication cannot propagate these items, you should implement equivalent logic in a SQL
Server CE-based application. Doing so ensures that the SQL Server CE database remains consistent with the SQL
Server database. For example, if the SQL Server database includes a CHECK constraint, the SQL Server CE-based
application should implement the corresponding check in application code.

● Case sensitivity

SQL Server CE databases are not case-sensitive; therefore objects and data are treated differently in a SQL Server
CE database from the way in which they are treated in a SQL Server database. For example, two tables, MYTABLE
and mytable, are treated as different objects in a case-sensitive SQL Server database. The same table names
cause a naming conflict in a SQL Server CE database. Similarly, two values, MYVALUE and myvalue, cause a
primary key violation in SQL Server CE, because they are treated as the same value, whereas they do not cause a
violation in a case-sensitive SQL Server database.

● UNIQUE constraints

SQL Server and SQL Server CE differ slightly in the way they implement UNIQUE constraints. SQL Server allows a
single NULL value in a column with a UNIQUE constraint; SQL Server CE does not allow a NULL value in this case.
If you subscribe to a publication that contains a NULL value in a column with a UNIQUE constraint, the creation of
that subscription fails on SQL Server CE.

● Tables and columns

For all replication tables, the number of available columns is 252 (255 – 3 system columns). SQL Server CE
allocates three system columns for tracking.

● NOT FOR REPLICATION constraints

SQL Server CE does not support the NOT FOR REPLICATION option. Do not create constraints using this option. If
constraints in a database have the NOT FOR REPLICATION option, remove the constraint and then re-create it. If
the NOT FOR REPLICATION option is specified, the constraint is still created on the SQL Server CE Subscriber, but
it does not include the NOT FOR REPLICATION syntax.

See Also

IDENTITY (Property)

Supported Data Types and Data Type Mappings

ReinitializeSubscription Method

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/...us/sqlce/htm/_lce_limitations_on_published_data.asp (2 of 2) [22/07/2004 08:09:01 p.m.]


Schema Changes on Publication Databases (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Planning for Replication

SQL Server CE Books Online

Schema Changes on Publication Databases


You can add and drop columns in a table published in a Microsoft® SQL Server™ publication without dropping and re-creating the publication. If you add
or drop a column in a published SQL Server table, that schema change is published to the subscription database in Microsoft SQL Server 2000 Windows®
CE Edition (SQL Server CE) when the publication is next synchronized. You must make schema changes to a published table through the replication
publication properties dialog box in SQL Server Enterprise Manager or through replication stored procedures. You cannot make schema changes to
published tables in any other way. For more information, see "Schema Changes on Publication Databases" in SQL Server Books Online.

If a column is dropped from the SQL Server publication database, any changes made to data in that corresponding column in the SQL Server CE
subscription database (that have not already been propagated to the Publisher) are discarded during synchronization.

You can add articles to an existing publication. When an article is added, the SQL Server CE Subscriber must be reinitialized.

Important The SQL Server CE Subscriber must also be reinitialized if the column that is added to an existing published SQL
Server table is an identity column.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter


©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_l..._changes_on_publication_databases_533.asp?frame=true [22/07/2004 08:09:27 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Planning for Replication
Advanced Search

SQL Server CE Books Online

Schema Changes on
Publication Databases
Up One Level You can add and drop columns in a table published in a Microsoft® SQL Server™ publication
without dropping and re-creating the publication. If you add or drop a column in a published
Replication Topologies SQL Server table, that schema change is published to the subscription database in Microsoft
SQL Server 2000 Windows® CE Edition (SQL Server CE) when the publication is next
Supported Data Types and Data Type Mappings synchronized. You must make schema changes to a published table through the replication
publication properties dialog box in SQL Server Enterprise Manager or through replication
Replication Limitations stored procedures. You cannot make schema changes to published tables in any other way.
For more information, see "Schema Changes on Publication Databases" in SQL Server Books
Schema Changes on Publication Databases Online.

Replication Conflict Detection and Resolution


If a column is dropped from the SQL Server publication database, any changes made to
data in that corresponding column in the SQL Server CE subscription database (that have
not already been propagated to the Publisher) are discarded during synchronization.

You can add articles to an existing publication. When an article is added, the SQL Server CE
Subscriber must be reinitialized.

Important The SQL Server CE Subscriber must also be reinitialized


if the column that is added to an existing published SQL Server table
is an identity column.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/l..._lce_schema_changes_on_publication_databases_533.asp [22/07/2004 08:09:29 p.m.]


Replication Conflict Detection and Resolution (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > Managing Connectivity > Using Replication > Planning for Replication

SQL Server CE Books Online

Replication Conflict Detection and Resolution


When Publishers and Subscribers are reconnected and synchronization occurs, the Merge Agent running on the Publisher detects conflicts and then
determines which data is accepted and propagated to other sites based on a resolver specified when the publication was created. Each Subscriber merges
with the Publisher, but conflicts typically occur between updates made at different Subscribers.

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports row-level tracking only. The SQL Server CE Database Engine invokes
tracking when a row is inserted, updated, or deleted. When conflicts are detected at the row level, changes made to corresponding rows are considered a
conflict, regardless of whether the changes are made to the same column. For example, a change is made to the address column of a row at the Publisher,
and another change is made to the phone number column of the corresponding row in the same table at the Subscriber. With row-level tracking, a conflict
is detected because changes were made to both rows.

Note Even if the Publisher is configured with column-level tracking, SQL Server CE masks the row as if every column has changed.
Row-level tracking involves less tracking overhead, preserving valuable storage space on the device.

Because SQL Server CE implements row-level tracking only, column-level tracking is ignored, even if it is configured on the Publisher. Therefore, a conflict
occurs even if the columns affected in the corresponding rows are not the same.

After a conflict is detected, the Merge Agent launches the conflict resolver selected for the article. In addition to the default resolver, merge replication
allows you to use a variety of custom resolvers to deal with conflict situations. The accepted changes are chosen according to the rules of the conflict
resolver. SQL Server CE Subscriber conflicts are always detected, resolved, and logged at the Publisher. For more information about conflict detection and
resolution, see "Merge Replication Conflict Detection and Resolution" in SQL Server Books Online.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce...ation_conflict_detection_and_resolution.asp?frame=true [23/07/2004 11:22:03 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
Managing Connectivity > Using Replication > Planning for Replication
Advanced Search

Up One Level
Replication Topologies
Supported Data Types and Data Type Mappings
Replication Limitations
Schema Changes on Publication Databases
Replication Conflict Detection and Resolution

http://msdn.microsoft.com/library/default.asp?url=/libr...merge_replication_conflict_detection_and_resolution.asp [23/07/2004 11:22:42 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0
MSDN Library Go
Advanced Search SQL Server CE Books Online
SQL Reference for SQL Server CE

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) includes SQL grammar that you can use to query a database and to insert, update, and
delete data in tables in a database. The topics in this section describe the SQL grammar, as well as the items listed in the following table.

For information about See


Up One Level SQL syntax conventions and query elements SQL Overview

SQL Overview Data types Data Types

+ (Add) Functions Functions

Information schema views Information Schema


+ (Positive) Operators Operators

+ (String Concatenation) Reserved words Reserved Words

- (Subtract)
- (Negative) SQL Server CE also includes SQL Server CE Query Analyzer, a tool you can use to query tables in a database. For more information, see Using SQL Server CE Query
* (Multiply) Analyzer.

/ (Divide)
% (Modulo) The examples in the reference topics were tested using isqlw_wce and are not case sensitive. For more information about SQL grammar and Transact-SQL usage
and examples, see SQL Server Books Online.
& (Bitwise AND)
| (Bitwise OR)
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
= (Equals)
> (Greater Than) Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

< (Less Than) ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

>= (Greater Than or Equal To)


<= (Less Than or Equal To)
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_reference_for_sql_server_ce.asp (1 of 4) [23/07/2004 11:23:43 a.m.]


Welcome to the MSDN Library

ABS
ACOS
ALL
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_reference_for_sql_server_ce.asp (2 of 4) [23/07/2004 11:23:43 a.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_reference_for_sql_server_ce.asp (3 of 4) [23/07/2004 11:23:43 a.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_reference_for_sql_server_ce.asp (4 of 4) [23/07/2004 11:23:43 a.m.]


SQL Overview (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


SQL Overview

You can use SQL grammar to query a database and to insert, update, and delete rows in tables in a database in Microsoft® SQL Server™ 2000 Windows® CE
Edition (SQL Server CE).

Syntax Conventions

The syntax diagrams in this reference use the following conventions.

Convention Used for


UPPERCASE SQL Server CE keywords.

Italic User-supplied parameters of SQL Server CE syntax.

| (vertical bar) Separating syntax items within brackets or braces. You can choose only one of the items.

[ ] (brackets) Optional syntax items. Do not type the brackets.

{} (braces) Required syntax items. Do not type the braces.

[,...n] Indicating that the preceding item can be repeated n number of times. The occurrences are separated by commas.

[ ...n] Indicating that the preceding item can be repeated n number of times. The occurrences are separated by blanks.

bold Database names, table names, column names, index names, stored procedures, utilities, data type names, and text that must be typed exactly as shown.

<label> ::= The name for a block of syntax. This convention is used to group and label portions of lengthy syntax or a unit of syntax that can be used in more than one place within a statement. Each
location in which the block of syntax can be used is indicated with the label enclosed in chevrons: <label>.

Query Elements

You can use identifiers, delimiters, and comments when you query a database in SQL Server CE.

Identifiers

The name of a database object is known as an identifier. The object name is created when the object is defined; the identifier is used to reference the object.

With SQL Server CE, because you must connect to a database that already exists in the device before you can execute queries, you do not need to qualify object
identifiers with owner, database, or server names. You can reference objects in one of these ways:

● object_name
● table_name.object_name

Delimiters

You must delimit identifiers when they do not comply with the rules for the format of regular identifiers or when reserved keywords are used as identifiers. The
following table summarizes the use of delimiters in SQL Server CE.

Delimiter Use in SQL Server CE


Brackets [ ] Not supported

Double quotation marks " " Noncompliant identifiers:

● Multiple-word identifiers
● Reserved words used as identifiers

Single quotation marks ' ' String data values

Comments

You can include text strings that should not be executed in the code as comments. Comments can be used to document code or to temporarily disable certain parts

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_sql_overview.asp?frame=true (1 of 2) [23/07/2004 11:24:53 a.m.]


SQL Overview (SQL Server CE Books Online)

of a SQL statement.

You can delineate text as comments using either of the following styles:

/* text_of_comment */
---- text_of_comment

Default Behavior

Queries executed through SQL Server CE Query Analyzer run with the following default behavior, which cannot be changed:

● QUOTED_IDENTIFIER_ON
● ANSI_NULLS_ON
● ANSI_PADDING_ON
● ANSI_NULL_DFLT_ON_ON
● CONCAT_NULL_YIELDS_NULL_ON

For more information, see Using SQL Server CE Query Analyzer.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_sql_overview.asp?frame=true (2 of 2) [23/07/2004 11:24:53 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
SQL Overview

You can use SQL grammar to query a database and to insert, update, and delete rows in tables in a database in Microsoft® SQL Server™ 2000 Windows® CE
Edition (SQL Server CE).

Syntax Conventions
Up One Level
SQL Overview The syntax diagrams in this reference use the following conventions.

+ (Add)
+ (Positive) Convention Used for
+ (String Concatenation) UPPERCASE SQL Server CE keywords.

- (Subtract) Italic User-supplied parameters of SQL Server CE syntax.

| (vertical bar) Separating syntax items within brackets or braces. You can choose only one of the items.
- (Negative) [ ] (brackets) Optional syntax items. Do not type the brackets.

* (Multiply) {} (braces) Required syntax items. Do not type the braces.

/ (Divide)
[,...n] Indicating that the preceding item can be repeated n number of times. The occurrences are separated by commas.

[ ...n] Indicating that the preceding item can be repeated n number of times. The occurrences are separated by blanks.

% (Modulo) bold Database names, table names, column names, index names, stored procedures, utilities, data type names, and text that must be typed exactly as shown.

& (Bitwise AND) <label> ::= The name for a block of syntax. This convention is used to group and label portions of lengthy syntax or a unit of syntax that can be used in more than one place within a statement. Each
location in which the block of syntax can be used is indicated with the label enclosed in chevrons: <label>.

| (Bitwise OR)
^ (Bitwise Exclusive OR) Query Elements
~ (Bitwise NOT)
= (Equals) You can use identifiers, delimiters, and comments when you query a database in SQL Server CE.

> (Greater Than)


< (Less Than) Identifiers
>= (Greater Than or Equal To)
<= (Less Than or Equal To) The name of a database object is known as an identifier. The object name is created when the object is defined; the identifier is used to reference the object.

<> (Not Equal To)


!= (Not Equal To) With SQL Server CE, because you must connect to a database that already exists in the device before you can execute queries, you do not need to qualify object
identifiers with owner, database, or server names. You can reference objects in one of these ways:
!< (Not Less Than)
!> (Not Greater Than) ● object_name

@@IDENTITY ● table_name.object_name

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_overview.asp (1 of 4) [23/07/2004 11:25:05 a.m.]


Welcome to the MSDN Library
Delimiters
ABS
ACOS You must delimit identifiers when they do not comply with the rules for the format of regular identifiers or when reserved keywords are used as identifiers. The
following table summarizes the use of delimiters in SQL Server CE.
ALL
ALTER TABLE
AND Delimiter Use in SQL Server CE
Brackets [ ] Not supported
ASIN Double quotation marks " " Noncompliant identifiers:

ATAN
ATN2
● Multiple-word identifiers
● Reserved words used as identifiers

AVG
BETWEEN Single quotation marks ' ' String data values

CASE
CEILING Comments
CHARINDEX
You can include text strings that should not be executed in the code as comments. Comments can be used to document code or to temporarily disable certain parts
COALESCE of a SQL statement.

COLLATE
CONVERT You can delineate text as comments using either of the following styles:

COS
COT /* text_of_comment */
---- text_of_comment
COUNT
CREATE DATABASE
Default Behavior
CREATE INDEX
CREATE TABLE Queries executed through SQL Server CE Query Analyzer run with the following default behavior, which cannot be changed:
DATALENGTH
Data Types ● QUOTED_IDENTIFIER_ON
ANSI_NULLS_ON
DATEADD

● ANSI_PADDING_ON
● ANSI_NULL_DFLT_ON_ON
CONCAT_NULL_YIELDS_NULL_ON
DATEDIFF

DATENAME For more information, see Using SQL Server CE Query Analyzer.

DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

DROP TABLE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

EXISTS
EXP
Expressions
FLOOR
FROM Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_overview.asp (2 of 4) [23/07/2004 11:25:05 a.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_overview.asp (3 of 4) [23/07/2004 11:25:05 a.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sql_overview.asp (4 of 4) [23/07/2004 11:25:05 a.m.]


+ (Add) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


+ (Add)

Adds two numbers. This addition arithmetic operator also can add a number, in days, to a date.

Syntax

expression + expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types in the numeric
category, except the bit data type.

Result Types

Returns the data type of the argument with the higher precedence.

Examples

The following example computes the total number of customers when the goal of adding 50 new customers is achieved. This query assumes that there are
90 customers listed in the Customers table in the Northwind database.

SELECT COUNT(CustomerID) + 50 AS "Target Total" FROM Customers

This is the result set:

Target Total
------------
140

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__add_.asp?frame=true [23/07/2004 11:25:29 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


+ (Add)

Adds two numbers. This addition arithmetic operator also can add a number, in days, to a
date.

Up One Level
Syntax
SQL Overview
+ (Add) expression + expression
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
* (Multiply) (SQL Server CE) of any of the data types in the numeric category, except the bit
data type.
/ (Divide)
% (Modulo)
Result Types
& (Bitwise AND)
| (Bitwise OR) Returns the data type of the argument with the higher precedence.
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
Examples
= (Equals)
> (Greater Than) The following example computes the total number of customers when the goal of adding 50
< (Less Than) new customers is achieved. This query assumes that there are 90 customers listed in the
Customers table in the Northwind database.
>= (Greater Than or Equal To)
<= (Less Than or Equal To) SELECT COUNT(CustomerID) + 50 AS "Target Total" FROM Customers
<> (Not Equal To)
!= (Not Equal To) This is the result set:

!< (Not Less Than)


!> (Not Greater Than) Target Total
------------
@@IDENTITY 140

ABS
ACOS
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__add_.asp (1 of 3) [23/07/2004 11:25:42 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
AVG
BETWEEN ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__add_.asp (2 of 3) [23/07/2004 11:25:42 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__add_.asp (3 of 3) [23/07/2004 11:25:42 a.m.]


+ (Positive) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


+ (Positive)

Is a unary operator that returns the positive value of a numeric expression.

Syntax

+ numeric_expression

Arguments

numeric_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types in the numeric data
type category, except the datetime data type.

Result Types

Returns the data type of numeric_expression, except that an unsigned tinyint expression is promoted to a smallint result.

Examples

The following examples use the Orders table in the Northwind database to show how the positive and negative unary operators function. When a
positive unary operator is set against a negative value, the returned value is negative (positive_value * negative_value = negative_value). When a
negative unary operator is set against a negative value, the returned value is positive (negative_value * negative_value = positive_value).

SELECT (DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--Without a unary operator, the value returned is '-12'.

SELECT +(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--With the positive unary operator, the value returned is '-12'.

SELECT -(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--With the negative unary operator, the value returned is '12'.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__positive_.asp?frame=true [23/07/2004 11:26:18 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
MSDN Library Go Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server
CE
Advanced Search

SQL Server CE Books Online


+ (Positive)

Is a unary operator that returns the positive value of a numeric expression.

Up One Level Syntax


SQL Overview
+ (Add) + numeric_expression

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
numeric_expression
- (Negative) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of
any of the data types in the numeric data type category, except the datetime data type.
* (Multiply)
/ (Divide)
Result Types
% (Modulo)
& (Bitwise AND) Returns the data type of numeric_expression, except that an unsigned tinyint expression is promoted to a
| (Bitwise OR) smallint result.

^ (Bitwise Exclusive OR)


~ (Bitwise NOT) Examples
= (Equals)
> (Greater Than) The following examples use the Orders table in the Northwind database to show how the positive and
negative unary operators function. When a positive unary operator is set against a negative value, the
< (Less Than) returned value is negative (positive_value * negative_value = negative_value). When a negative unary
operator is set against a negative value, the returned value is positive (negative_value * negative_value =
>= (Greater Than or Equal To) positive_value).

<= (Less Than or Equal To)


<> (Not Equal To) SELECT (DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--Without a unary operator, the value returned is '-12'.
!= (Not Equal To) SELECT +(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'

!< (Not Less Than)


--With the positive unary operator, the value returned is '-12'.

SELECT -(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
!> (Not Greater Than) --With the negative unary operator, the value returned is '12'.

@@IDENTITY
ABS
ACOS
ALL
ALTER TABLE Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
AND
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |
ASIN Privacy Statement

ATAN
ATN2
AVG
BETWEEN
CASE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__positive_.asp (1 of 3) [23/07/2004 11:26:34 a.m.]


Welcome to the MSDN Library

CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__positive_.asp (2 of 3) [23/07/2004 11:26:34 a.m.]


Welcome to the MSDN Library

PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__positive_.asp (3 of 3) [23/07/2004 11:26:34 a.m.]


+ (String Concatenation) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


+ (String Concatenation)

Is an operator in a string expression that concatenates two or more character or binary strings, columns, or a combination of strings and column names
into one expression.

Syntax

expression + expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types in the character and
binary data type categories, except the image and ntext data types. Both expressions must be of the same data type, or one expression must
be able to be implicitly converted to the data type of the other expression.

Result Types

Returns the data type of the argument with the highest precedence.

Examples

The following example uses the + operator to get an alphabetical listing of all employees in the Northwind database.

SELECT FirstName + ' ' + LastName AS "Employee Listing" FROM Employees ORDER BY FirstName

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__string_concatenation_.asp?frame=true [23/07/2004 11:30:50 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL
Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


+ (String Concatenation)

Is an operator in a string expression that concatenates two or more character or binary strings,
columns, or a combination of strings and column names into one expression.

Up One Level
Syntax
SQL Overview
+ (Add) expression + expression
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
* (Multiply) Server CE) of any of the data types in the character and binary data type categories,
except the image and ntext data types. Both expressions must be of the same data
/ (Divide) type, or one expression must be able to be implicitly converted to the data type of the
other expression.
% (Modulo)
& (Bitwise AND)
Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) Returns the data type of the argument with the highest precedence.
~ (Bitwise NOT)
= (Equals)
Examples
> (Greater Than)
< (Less Than) The following example uses the + operator to get an alphabetical listing of all employees in the
>= (Greater Than or Equal To) Northwind database.

<= (Less Than or Equal To)


<> (Not Equal To) SELECT FirstName + ' ' + LastName AS "Employee Listing" FROM Employees ORDER BY FirstName

!= (Not Equal To)


!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ACOS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |

ALL Privacy Statement

ALTER TABLE
AND
ASIN
ATAN
ATN2

http://msdn.microsoft.com/library/default.asp?url=/...ary/en-us/sqlce/htm/_lce__string_concatenation_.asp (1 of 3) [23/07/2004 11:31:01 a.m.]


Welcome to the MSDN Library

AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN

http://msdn.microsoft.com/library/default.asp?url=/...ary/en-us/sqlce/htm/_lce__string_concatenation_.asp (2 of 3) [23/07/2004 11:31:01 a.m.]


Welcome to the MSDN Library

NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/...ary/en-us/sqlce/htm/_lce__string_concatenation_.asp (3 of 3) [23/07/2004 11:31:01 a.m.]


- (Subtract) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


- (Subtract)

Subtracts two numbers. This subtraction arithmetic operator can also subtract a number, in days, from a date.

Syntax

expression - expression

Arguments

expression
Is any valid expression Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the numeric data type
category, except the bit data type.

Result Types

Returns the data type of the argument with the higher precedence.

Examples

The following example uses the subtraction arithmetic operator to get the number of days between the time a Northwind customer placed an order and
when the order was shipped.

SELECT (DATEPART(day, ShippedDate) - DATEPART(day, OrderDate)) FROM Orders WHERE OrderID = '10248'
--The value returned is '12'.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__subtract_.asp?frame=true [23/07/2004 11:31:19 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
MSDN Library Go Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server
CE
Advanced Search

SQL Server CE Books Online


- (Subtract)

Subtracts two numbers. This subtraction arithmetic operator can also subtract a number, in days, from a
date.

Up One Level
Syntax
SQL Overview
+ (Add) expression - expression
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) expression
Is any valid expression Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of
* (Multiply) any of the data types of the numeric data type category, except the bit data type.

/ (Divide)
% (Modulo) Result Types
& (Bitwise AND)
| (Bitwise OR) Returns the data type of the argument with the higher precedence.

^ (Bitwise Exclusive OR)


~ (Bitwise NOT) Examples
= (Equals)
> (Greater Than) The following example uses the subtraction arithmetic operator to get the number of days between the time
a Northwind customer placed an order and when the order was shipped.
< (Less Than)
>= (Greater Than or Equal To) SELECT (DATEPART(day, ShippedDate) - DATEPART(day, OrderDate)) FROM Orders WHERE OrderID = '10248'
<= (Less Than or Equal To) --The value returned is '12'.

<> (Not Equal To)


!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ABS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |

ACOS Privacy Statement

ALL
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__subtract_.asp (1 of 3) [23/07/2004 11:31:31 a.m.]


Welcome to the MSDN Library

CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__subtract_.asp (2 of 3) [23/07/2004 11:31:31 a.m.]


Welcome to the MSDN Library

ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__subtract_.asp (3 of 3) [23/07/2004 11:31:31 a.m.]


- (Negative) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


- (Negative)

Is a unary operator that returns the negative value of a numeric expression.

Syntax

- numeric_expression

Arguments

numeric_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the numeric data
type category, except the datetime data type.

Result Types

Returns the data type of numeric_expression, except that an unsigned tinyint expression is promoted to a signed smallint result.

Examples

The following examples use the Northwind database to show how the positive and negative unary operators function. When a positive unary operator is
set against a negative value, the returned value is negative (positive_value * negative_value = negative_value). When a negative unary operator is set
against a negative value, the returned value is positive (negative_value * negative_value = positive_value).

SELECT -(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--With the negative unary operator, the value returned is '12'.

SELECT (DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--Without a unary operator, the value returned is '-12'.

SELECT +(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--With the positive unary operator, the value returned is '-12'.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__negative_.asp?frame=true [23/07/2004 11:32:23 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
MSDN Library Go Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server
CE
Advanced Search

SQL Server CE Books Online


- (Negative)

Is a unary operator that returns the negative value of a numeric expression.

Up One Level Syntax


SQL Overview
+ (Add) - numeric_expression

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
numeric_expression
- (Negative) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of
any of the data types of the numeric data type category, except the datetime data type.
* (Multiply)
/ (Divide)
Result Types
% (Modulo)
& (Bitwise AND) Returns the data type of numeric_expression, except that an unsigned tinyint expression is promoted to a
| (Bitwise OR) signed smallint result.

^ (Bitwise Exclusive OR)


~ (Bitwise NOT) Examples
= (Equals)
> (Greater Than) The following examples use the Northwind database to show how the positive and negative unary operators
function. When a positive unary operator is set against a negative value, the returned value is negative
< (Less Than) (positive_value * negative_value = negative_value). When a negative unary operator is set against a
negative value, the returned value is positive (negative_value * negative_value = positive_value).
>= (Greater Than or Equal To)
<= (Less Than or Equal To) SELECT -(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
<> (Not Equal To) --With the negative unary operator, the value returned is '12'.

!= (Not Equal To)


SELECT (DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--Without a unary operator, the value returned is '-12'.

!< (Not Less Than) SELECT +(DATEPART(day, OrderDate) - DATEPART(day, ShippedDate)) FROM Orders WHERE OrderID = '10248'
--With the positive unary operator, the value returned is '-12'.
!> (Not Greater Than)
@@IDENTITY
ABS
ACOS
ALL
ALTER TABLE Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

AND ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |
Privacy Statement
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__negative_.asp (1 of 3) [23/07/2004 11:32:42 a.m.]


Welcome to the MSDN Library

CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__negative_.asp (2 of 3) [23/07/2004 11:32:42 a.m.]


Welcome to the MSDN Library

PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__negative_.asp (3 of 3) [23/07/2004 11:32:42 a.m.]


* (Multiply) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


* (Multiply)

Multiplies two expressions (an arithmetic multiplication operator).

Syntax

expression * expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the numeric data
type category, except the datetime data type.

Result Types

Returns the data type of the argument with the higher precedence.

Examples

The following example determines the cost of a customer order by multiplying the quantity ordered by the unit price from the Order Details table in the
Northwind database.

SELECT UnitPrice * Quantity AS "Total Cost" FROM "Order Details" WHERE ProductID = '11' AND OrderID = '10248'

This is the result set:

Total Cost
----------
168

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__multiply_.asp?frame=true [23/07/2004 11:34:01 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000
MSDN Library Go Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
* (Multiply)

Multiplies two expressions (an arithmetic multiplication operator).

Syntax
Up One Level
SQL Overview expression * expression

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the
- (Negative) data types of the numeric data type category, except the datetime data type.

* (Multiply)
/ (Divide) Result Types
% (Modulo)
Returns the data type of the argument with the higher precedence.
& (Bitwise AND)
| (Bitwise OR)
^ (Bitwise Exclusive OR) Examples
~ (Bitwise NOT)
The following example determines the cost of a customer order by multiplying the quantity ordered by the unit price from
= (Equals) the Order Details table in the Northwind database.

> (Greater Than)


< (Less Than) SELECT UnitPrice * Quantity AS "Total Cost" FROM "Order Details" WHERE ProductID = '11' AND OrderID = '10248'

>= (Greater Than or Equal To)


<= (Less Than or Equal To) This is the result set:

<> (Not Equal To)


!= (Not Equal To) Total Cost
----------
!< (Not Less Than) 168

!> (Not Greater Than)


@@IDENTITY
ABS
ACOS
ALL Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ALTER TABLE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__multiply_.asp (1 of 3) [23/07/2004 11:34:13 a.m.]


Welcome to the MSDN Library

COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__multiply_.asp (2 of 3) [23/07/2004 11:34:13 a.m.]


Welcome to the MSDN Library

REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__multiply_.asp (3 of 3) [23/07/2004 11:34:13 a.m.]


/ (Divide) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


/ (Divide)

Divides one number by another (an arithmetic division operator).

Syntax

dividend / divisor

Arguments

dividend
Is the numeric expression to divide. dividend can be any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE) of any of the data types of the numeric data type category, except the datetime data type.
divisor
Is the numeric expression to divide the dividend by. divisor can be any valid SQL Server expression of any of the data types of the numeric
data type category, except the datetime data type.

Result Types

Returns the data type of the argument with the higher precedence.

Examples

The following example uses the divide arithmetic operator to determine the average total cost for each order of product 51 in the Northwind database.
Product 51 has 39 orders.

SELECT (SUM(UnitPrice * Quantity))/39 AS "Avg. Cost per Order" FROM "Order Details" WHERE ProductID = '51'

This is the result set:

Avg. Cost per Order


-------------------
1147.2461

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__divide_.asp?frame=true [23/07/2004 11:34:50 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server
MSDN Library Go 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
/ (Divide)

Divides one number by another (an arithmetic division operator).

Syntax
Up One Level
SQL Overview dividend / divisor

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) dividend
Is the numeric expression to divide. dividend can be any valid expression in Microsoft® SQL Server™ 2000
- (Negative) Windows® CE Edition (SQL Server CE) of any of the data types of the numeric data type category, except
the datetime data type.
* (Multiply) divisor
Is the numeric expression to divide the dividend by. divisor can be any valid SQL Server expression of any
/ (Divide) of the data types of the numeric data type category, except the datetime data type.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
Returns the data type of the argument with the higher precedence.
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
The following example uses the divide arithmetic operator to determine the average total cost for each order of
< (Less Than) product 51 in the Northwind database. Product 51 has 39 orders.

>= (Greater Than or Equal To)


<= (Less Than or Equal To) SELECT (SUM(UnitPrice * Quantity))/39 AS "Avg. Cost per Order" FROM "Order Details" WHERE ProductID = '51'

<> (Not Equal To)


!= (Not Equal To) This is the result set:

!< (Not Less Than)


!> (Not Greater Than) Avg. Cost per Order
-------------------
@@IDENTITY 1147.2461

ABS
ACOS
ALL
ALTER TABLE
AND Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ASIN ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__divide_.asp (1 of 3) [23/07/2004 11:35:00 a.m.]


Welcome to the MSDN Library

COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__divide_.asp (2 of 3) [23/07/2004 11:35:00 a.m.]


Welcome to the MSDN Library

RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__divide_.asp (3 of 3) [23/07/2004 11:35:00 a.m.]


% (Modulo) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


% (Modulo)

Provides the remainder of one number divided by another.

Syntax

dividend % divisor

Arguments

dividend
Is the numeric expression to divide. dividend must be any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL
Server CE) of the integer data type category.
divisor
Is the numeric expression to divide the dividend by. divisor must be any valid SQL Server expression of any of the data types of the integer
data type category.

Result Types

int

Examples

The following example uses modulo to identify employees in the Northwind database with even-numbered EmployeeID values.

SELECT EmployeeID, LastName, EmployeeID % 2 FROM Employees WHERE EmployeeID % 2 = '0'

This is the result set:

EmployeeID LastName #2
---------- -------- ---
2 Fuller 0
4 Peacock 0
6 Suyama 0
8 Callahan 0

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__modulo_.asp?frame=true [23/07/2004 11:35:20 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


% (Modulo)

Provides the remainder of one number divided by another.

Up One Level Syntax


SQL Overview
+ (Add) dividend % divisor

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
dividend
- (Negative) Is the numeric expression to divide. dividend must be any valid expression in
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of the
* (Multiply) integer data type category.
divisor
/ (Divide) Is the numeric expression to divide the dividend by. divisor must be any valid SQL
Server expression of any of the data types of the integer data type category.
% (Modulo)
& (Bitwise AND)
Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) int
~ (Bitwise NOT)
= (Equals)
Examples
> (Greater Than)
< (Less Than) The following example uses modulo to identify employees in the Northwind database with
>= (Greater Than or Equal To) even-numbered EmployeeID values.

<= (Less Than or Equal To)


<> (Not Equal To) SELECT EmployeeID, LastName, EmployeeID % 2 FROM Employees WHERE EmployeeID % 2 = '0'

!= (Not Equal To) This is the result set:


!< (Not Less Than)
!> (Not Greater Than) EmployeeID LastName #2
@@IDENTITY ----------
2
--------
Fuller
---
0
ABS 4
6
Peacock
Suyama
0
0
ACOS 8 Callahan 0

ALL
ALTER TABLE
AND
ASIN
ATAN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__modulo_.asp (1 of 3) [23/07/2004 11:35:30 a.m.]


Welcome to the MSDN Library

ATN2
AVG
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
BETWEEN
CASE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__modulo_.asp (2 of 3) [23/07/2004 11:35:30 a.m.]


Welcome to the MSDN Library

LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__modulo_.asp (3 of 3) [23/07/2004 11:35:30 a.m.]


& (Bitwise AND) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


& (Bitwise AND)

Performs a bitwise logical AND operation between two integer values.

Syntax

expression & expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the integer data
type category. expression is an integer parameter that is treated and transformed into a binary number for the bitwise operation.

Result Types

Returns an int if the input values are int, a smallint if the input values are smallint, or a tinyint if the input values are tinyint.

Examples

The following example performs the bitwise AND operation between two integer columns.

CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)
SELECT a_int_value & b_int_value FROM bitwise
--Returns 10.

The binary representation of 170 (a_int_value or A, below) is 0000 0000 1010 1010. The binary representation of 75 (b_int_value or B, below) is 0000
0000 0100 1011. Performing the bitwise AND operation on these two values produces the binary result 0000 0000 0000 1010, which is decimal 10.

(A & B)
0000 0000 1010 1010
0000 0000 0100 1011
-------------------
0000 0000 0000 1010

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__bitwise_and_.asp?frame=true [23/07/2004 11:36:30 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


& (Bitwise AND)

Performs a bitwise logical AND operation between two integer values.

Up One Level Syntax


SQL Overview
+ (Add) expression & expression

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
expression
- (Negative) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE) of any of the data types of the integer data type category.
* (Multiply) expression is an integer parameter that is treated and transformed into a binary
number for the bitwise operation.
/ (Divide)
% (Modulo)
Result Types
& (Bitwise AND)
| (Bitwise OR) Returns an int if the input values are int, a smallint if the input values are smallint, or a
^ (Bitwise Exclusive OR) tinyint if the input values are tinyint.

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example performs the bitwise AND operation between two integer columns.

>= (Greater Than or Equal To)


<= (Less Than or Equal To) CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)
<> (Not Equal To) SELECT a_int_value & b_int_value FROM bitwise
--Returns 10.
!= (Not Equal To)
!< (Not Less Than) The binary representation of 170 (a_int_value or A, below) is 0000 0000 1010 1010. The
binary representation of 75 (b_int_value or B, below) is 0000 0000 0100 1011. Performing
!> (Not Greater Than) the bitwise AND operation on these two values produces the binary result 0000 0000 0000
1010, which is decimal 10.
@@IDENTITY
ABS (A & B)
ACOS 0000 0000 1010 1010
0000 0000 0100 1011
ALL -------------------
0000 0000 0000 1010
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_and_.asp (1 of 3) [23/07/2004 11:36:39 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
AVG
BETWEEN ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_and_.asp (2 of 3) [23/07/2004 11:36:39 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_and_.asp (3 of 3) [23/07/2004 11:36:39 a.m.]


| (Bitwise OR) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


| (Bitwise OR)

Performs a bitwise logical OR operation between two given integer values as translated to binary expressions within SQL statements.

Syntax

expression | expression

Arguments

expression

Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the
integer data type category. expression is an integer that is treated and transformed into a binary number for the bitwise operation.

Result Types

Returns an int if the input values are int, a smallint if the input values are smallint, or a tinyint if the input values are tinyint.

Examples

The following example performs the bitwise OR operation between two integer columns.

CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)
SELECT a_int_value | b_int_value FROM bitwise
--Returns 235

The binary representation of 170 (a_int_value or A, below) is 0000 0000 1010 1010. The binary representation of 75 (b_int_value or B, below) is 0000
0000 0100 1011. Performing the bitwise OR operation on these two values produces the binary result 0000 0000 1110 1011, which is decimal 235.

(A | B)
0000 0000 1010 1010
0000 0000 0100 1011
-------------------
0000 0000 1110 1011

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__bitwise_or_.asp?frame=true [23/07/2004 11:37:21 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


| (Bitwise OR)

Performs a bitwise logical OR operation between two given integer values as translated to
binary expressions within SQL statements.

Up One Level
Syntax
SQL Overview
+ (Add) expression | expression
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) expression

* (Multiply)
/ (Divide) Is any valid expression in Microsoft® SQL Server™ 2000 Windows®
CE Edition (SQL Server CE) of any of the data types of the integer
% (Modulo) data type category. expression is an integer that is treated and
transformed into a binary number for the bitwise operation.
& (Bitwise AND)
| (Bitwise OR) Result Types
^ (Bitwise Exclusive OR)
~ (Bitwise NOT) Returns an int if the input values are int, a smallint if the input values are smallint, or a
tinyint if the input values are tinyint.
= (Equals)
> (Greater Than)
< (Less Than) Examples
>= (Greater Than or Equal To)
<= (Less Than or Equal To) The following example performs the bitwise OR operation between two integer columns.

<> (Not Equal To)


!= (Not Equal To) CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)

!< (Not Less Than) SELECT a_int_value | b_int_value FROM bitwise


--Returns 235

!> (Not Greater Than)


@@IDENTITY The binary representation of 170 (a_int_value or A, below) is 0000 0000 1010 1010. The
binary representation of 75 (b_int_value or B, below) is 0000 0000 0100 1011. Performing
ABS the bitwise OR operation on these two values produces the binary result 0000 0000 1110
1011, which is decimal 235.
ACOS
ALL (A | B)
ALTER TABLE 0000 0000 1010 1010
0000 0000 0100 1011
AND -------------------
0000 0000 1110 1011
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_or_.asp (1 of 3) [23/07/2004 11:37:30 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
BETWEEN
CASE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_or_.asp (2 of 3) [23/07/2004 11:37:30 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_or_.asp (3 of 3) [23/07/2004 11:37:30 a.m.]


^ (Bitwise Exclusive OR) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


^ (Bitwise Exclusive OR)

Performs a bitwise exclusive OR operation between two given integer values as translated to binary expressions within SQL statements.

Syntax

expression ^ expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the integer data
type category, or of the binary or varbinary data type. expression is an integer that is treated and transformed into a binary number for the
bitwise operation.

Result Types

Returns an int if the input values are int, a smallint if the input values are smallint, or a tinyint if the input values are tinyint.

Examples

The following example performs the bitwise exclusive OR operation between two integer columns.

CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)
SELECT a_int_value ^ b_int_value FROM bitwise
--Returns 225

The binary representation of 170 (a_int_value or A, below) is 0000 0000 1010 1010. The binary representation of 75 (b_int_value or B, below) is 0000
0000 0100 1011. Performing the bitwise exclusive OR operation on these two values produces the binary result 0000 0000 1110 0001, which is decimal
225.

(A ^ B)
0000 0000 1010 1010
0000 0000 0100 1011
-------------------
0000 0000 1110 0001

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__bitwise_exclusive_or_.asp?frame=true [23/07/2004 11:38:20 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


^ (Bitwise Exclusive OR)

Performs a bitwise exclusive OR operation between two given integer values as translated to
binary expressions within SQL statements.

Up One Level
Syntax
SQL Overview
+ (Add) expression ^ expression
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
* (Multiply) (SQL Server CE) of any of the data types of the integer data type category, or of
the binary or varbinary data type. expression is an integer that is treated and
/ (Divide) transformed into a binary number for the bitwise operation.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) Returns an int if the input values are int, a smallint if the input values are smallint, or a
tinyint if the input values are tinyint.
~ (Bitwise NOT)
= (Equals)
Examples
> (Greater Than)
< (Less Than) The following example performs the bitwise exclusive OR operation between two integer
>= (Greater Than or Equal To) columns.

<= (Less Than or Equal To)


<> (Not Equal To) CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)
!= (Not Equal To) SELECT a_int_value ^ b_int_value FROM bitwise
--Returns 225
!< (Not Less Than)
!> (Not Greater Than) The binary representation of 170 (a_int_value or A, below) is 0000 0000 1010 1010. The
binary representation of 75 (b_int_value or B, below) is 0000 0000 0100 1011. Performing
@@IDENTITY the bitwise exclusive OR operation on these two values produces the binary result 0000
0000 1110 0001, which is decimal 225.
ABS
ACOS (A ^ B)
ALL 0000 0000 1010 1010
0000 0000 0100 1011
ALTER TABLE -------------------
0000 0000 1110 0001
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/...ary/en-us/sqlce/htm/_lce__bitwise_exclusive_or_.asp (1 of 3) [23/07/2004 11:38:30 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
BETWEEN
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
CASE Trademarks |Privacy Statement

CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/...ary/en-us/sqlce/htm/_lce__bitwise_exclusive_or_.asp (2 of 3) [23/07/2004 11:38:30 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/...ary/en-us/sqlce/htm/_lce__bitwise_exclusive_or_.asp (3 of 3) [23/07/2004 11:38:30 a.m.]


~ (Bitwise NOT) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


~ (Bitwise NOT)

Performs a bitwise logical NOT operation for one given integer value as translated to binary expressions within SQL statements.

Syntax

~ expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the integer data
type category, or of the binary or varbinary data type. expression is an integer that is treated and transformed into a binary number for the
bitwise operation.

Result Types

Returns an int if the input values are int, a smallint if the input values are smallint, a tinyint if the input values are tinyint, or a bit if the input values
are bit.

Examples

The following example performs the bitwise NOT operation between two integer columns.

CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
INSERT bitwise VALUES (170, 75)
SELECT ~ a_int_value, ~ b_int_value FROM bitwise
--Returns -171 and -76

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__bitwise_not_.asp?frame=true [23/07/2004 11:39:49 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


~ (Bitwise NOT)

Performs a bitwise logical NOT operation for one given integer value as translated to binary
expressions within SQL statements.

Up One Level
Syntax
SQL Overview
+ (Add) ~ expression
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
* (Multiply) (SQL Server CE) of any of the data types of the integer data type category, or of
the binary or varbinary data type. expression is an integer that is treated and
/ (Divide) transformed into a binary number for the bitwise operation.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) Returns an int if the input values are int, a smallint if the input values are smallint, a
tinyint if the input values are tinyint, or a bit if the input values are bit.
~ (Bitwise NOT)
= (Equals)
Examples
> (Greater Than)
< (Less Than) The following example performs the bitwise NOT operation between two integer columns.
>= (Greater Than or Equal To)
<= (Less Than or Equal To) CREATE TABLE bitwise (a_int_value int NOT NULL, b_int_value int NOT NULL)
<> (Not Equal To) INSERT bitwise VALUES (170, 75)
SELECT ~ a_int_value, ~ b_int_value FROM bitwise
!= (Not Equal To) --Returns -171 and -76

!< (Not Less Than)


!> (Not Greater Than)
@@IDENTITY
ABS
ACOS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ALL ©2004 Microsoft Corporation. All rights reserved. Terms of Use |

ALTER TABLE Trademarks |Privacy Statement

AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_not_.asp (1 of 3) [23/07/2004 11:39:59 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_not_.asp (2 of 3) [23/07/2004 11:39:59 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__bitwise_not_.asp (3 of 3) [23/07/2004 11:39:59 a.m.]


= (Equals) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


= (Equals)

Compares two expressions (a comparison operator). When you compare nonnull expressions, the result is TRUE when both operands are equal; otherwise,
the result is FALSE.

Syntax

expression = expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the equals comparison operator to focus a search to a specific customer in the Orders table in the Northwind database.

SELECT * FROM Orders WHERE CustomerID = 'VINET'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__equals_.asp?frame=true [23/07/2004 11:40:41 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


= (Equals)

Compares two expressions (a comparison operator). When you compare nonnull


expressions, the result is TRUE when both operands are equal; otherwise, the result is
FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression = expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the equals comparison operator to focus a search to a specific
customer in the Orders table in the Northwind database.
>= (Greater Than or Equal To)
<= (Less Than or Equal To) SELECT * FROM Orders WHERE CustomerID = 'VINET'
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
ABS
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
ACOS Trademarks |Privacy Statement
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__equals_.asp (1 of 3) [23/07/2004 11:40:50 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__equals_.asp (2 of 3) [23/07/2004 11:40:50 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__equals_.asp (3 of 3) [23/07/2004 11:40:50 a.m.]


> (Greater Than) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


> (Greater Than)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
has a value higher than the right operand; otherwise, the result is FALSE.

Syntax

expression > expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the greater than comparison operator to find all orders in the Order Details table of the Northwind database with quantities
of more than 100 units.

SELECT * FROM "Order Details" WHERE Quantity > '100'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__greater_than_.asp?frame=true [23/07/2004 11:41:01 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


> (Greater Than)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand has a value higher
than the right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression > expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the greater than comparison operator to find all orders in the
Order Details table of the Northwind database with quantities of more than 100 units.
>= (Greater Than or Equal To)
<= (Less Than or Equal To) SELECT * FROM "Order Details" WHERE Quantity > '100'
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
ABS
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
ACOS Trademarks |Privacy Statement
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__greater_than_.asp (1 of 3) [23/07/2004 11:41:10 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__greater_than_.asp (2 of 3) [23/07/2004 11:41:10 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__greater_than_.asp (3 of 3) [23/07/2004 11:41:10 a.m.]


< (Less Than) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


< (Less Than)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
has a value lower than the right operand; otherwise, the result is FALSE.

Syntax

expression < expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the less than comparison operator to find all orders in the Order Details table of the Northwind database with quantities
fewer than 10 units.

SELECT * FROM "Order Details" WHERE Quantity < '10'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__less_than_.asp?frame=true [23/07/2004 11:41:47 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


< (Less Than)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand has a value lower
than the right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression < expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the less than comparison operator to find all orders in the
Order Details table of the Northwind database with quantities fewer than 10 units.
>= (Greater Than or Equal To)
<= (Less Than or Equal To) SELECT * FROM "Order Details" WHERE Quantity < '10'
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
ABS
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
ACOS Trademarks |Privacy Statement
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__less_than_.asp (1 of 3) [23/07/2004 11:41:56 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__less_than_.asp (2 of 3) [23/07/2004 11:41:56 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__less_than_.asp (3 of 3) [23/07/2004 11:41:56 a.m.]


>= (Greater Than or Equal To) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


>= (Greater Than or Equal To)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
has a value higher than or equal to the right operand; otherwise, the result is FALSE.

Syntax

expression > = expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the greater than or equal to comparison operator to find all orders in the Order Details table of the Northwind database
with quantities equal to or more than 100 units.

SELECT * FROM "Order Details" WHERE Quantity >= '100'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__greater_than_or_equal_to_.asp?frame=true [23/07/2004 11:42:55 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


>= (Greater Than or Equal To)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand has a value higher
than or equal to the right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression > = expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the greater than or equal to comparison operator to find all
orders in the Order Details table of the Northwind database with quantities equal to or
>= (Greater Than or Equal To) more than 100 units.

<= (Less Than or Equal To)


<> (Not Equal To) SELECT * FROM "Order Details" WHERE Quantity >= '100'

!= (Not Equal To)


!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ACOS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |

ALL Trademarks |Privacy Statement

ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=...n-us/sqlce/htm/_lce__greater_than_or_equal_to_.asp (1 of 3) [23/07/2004 11:43:04 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=...n-us/sqlce/htm/_lce__greater_than_or_equal_to_.asp (2 of 3) [23/07/2004 11:43:04 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=...n-us/sqlce/htm/_lce__greater_than_or_equal_to_.asp (3 of 3) [23/07/2004 11:43:04 a.m.]


<= (Less Than or Equal To) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


<= (Less Than or Equal To)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
has a value lower than or equal to the right operand; otherwise, the result is FALSE.

Syntax

expression < = expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the less than or equal to comparison operator to find all orders in the Order Details table of the Northwind database with
quantities equal to or less than 10 units.

SELECT * FROM "Order Details" WHERE Quantity <= '10'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__less_than_or_equal_to_.asp?frame=true [23/07/2004 11:44:42 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


<= (Less Than or Equal To)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand has a value lower
than or equal to the right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression < = expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the less than or equal to comparison operator to find all orders
in the Order Details table of the Northwind database with quantities equal to or less than
>= (Greater Than or Equal To) 10 units.

<= (Less Than or Equal To)


<> (Not Equal To) SELECT * FROM "Order Details" WHERE Quantity <= '10'

!= (Not Equal To)


!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ACOS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |

ALL Trademarks |Privacy Statement

ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=...y/en-us/sqlce/htm/_lce__less_than_or_equal_to_.asp (1 of 3) [23/07/2004 11:44:51 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=...y/en-us/sqlce/htm/_lce__less_than_or_equal_to_.asp (2 of 3) [23/07/2004 11:44:51 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=...y/en-us/sqlce/htm/_lce__less_than_or_equal_to_.asp (3 of 3) [23/07/2004 11:44:51 a.m.]


<> (Not Equal To) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


<> (Not Equal To)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
is not equal to the right operand; otherwise, the result is FALSE.

Syntax

expression < > expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the not equal to comparison operator to find all orders in the Order Details table of the Northwind database with quantities
not equal to 100 units.

SELECT * FROM "Order Details" WHERE Quantity <> '100'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__not_equal_to_.asp?frame=true [23/07/2004 11:48:15 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


<> (Not Equal To)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand is not equal to the
right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression < > expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the not equal to comparison operator to find all orders in the
Order Details table of the Northwind database with quantities not equal to 100 units.
>= (Greater Than or Equal To)
<= (Less Than or Equal To) SELECT * FROM "Order Details" WHERE Quantity <> '100'
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
ABS
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
ACOS Trademarks |Privacy Statement
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_equal_to_.asp (1 of 3) [23/07/2004 11:48:28 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_equal_to_.asp (2 of 3) [23/07/2004 11:48:28 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_equal_to_.asp (3 of 3) [23/07/2004 11:48:28 a.m.]


!= (Not Equal To) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


!= (Not Equal To)

Tests whether one expression is not equal to another expression (a comparison operator). Functions the same as Not Equal To (<>).

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__not_equal_to__2.asp?frame=true [23/07/2004 11:50:46 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


!= (Not Equal To)

Tests whether one expression is not equal to another expression (a comparison operator).
Functions the same as Not Equal To (<>).

Up One Level
SQL Overview
+ (Add)
+ (Positive)
+ (String Concatenation) Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

- (Subtract) ©2004 Microsoft Corporation. All rights reserved. Terms of Use |


Trademarks |Privacy Statement
- (Negative)
* (Multiply)
/ (Divide)
% (Modulo)
& (Bitwise AND)
| (Bitwise OR)
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
= (Equals)
> (Greater Than)
< (Less Than)
>= (Greater Than or Equal To)
<= (Less Than or Equal To)
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS
ACOS
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_equal_to__2.asp (1 of 3) [23/07/2004 11:50:55 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_equal_to__2.asp (2 of 3) [23/07/2004 11:50:55 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_equal_to__2.asp (3 of 3) [23/07/2004 11:50:55 a.m.]


!< (Not Less Than) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


!< (Not Less Than)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
does not have a value lower than the right operand; otherwise, the result is FALSE.

Syntax

expression ! < expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the not less than comparison operator to find all orders in the Order Details table of the Northwind database with quantities
that are equal to or more than 100 units.

SELECT * FROM "Order Details" WHERE Quantity !< '100'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__not_less_than_.asp?frame=true [23/07/2004 11:53:21 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


!< (Not Less Than)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand does not have a
value lower than the right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression ! < expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the not less than comparison operator to find all orders in the
Order Details table of the Northwind database with quantities that are equal to or more
>= (Greater Than or Equal To) than 100 units.

<= (Less Than or Equal To)


<> (Not Equal To) SELECT * FROM "Order Details" WHERE Quantity !< '100'

!= (Not Equal To)


!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ACOS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |

ALL Trademarks |Privacy Statement

ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_less_than_.asp (1 of 3) [23/07/2004 11:53:30 a.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_less_than_.asp (2 of 3) [23/07/2004 11:53:30 a.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_less_than_.asp (3 of 3) [23/07/2004 11:53:30 a.m.]


!> (Not Greater Than) (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


!> (Not Greater Than)

Compares two expressions (a comparison operator). When you compare nonnull expressions using this operator, the result is TRUE when the left operand
does not have a value higher than the right operand; otherwise, the result is FALSE.

Syntax

expression ! > expression

Arguments

expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). Both expressions must have implicitly
convertible data types. The conversion depends on the rules of data type precedence.

Result Types

bit

Examples

The following example uses the not greater than comparison operator to find all orders in the Order Details table of the Northwind database with
quantities equal to or less than 10 units.

SELECT * FROM "Order Details" WHERE Quantity !> '10'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce__not_greater_than_.asp?frame=true [23/07/2004 12:01:37 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


!> (Not Greater Than)

Compares two expressions (a comparison operator). When you compare nonnull


expressions using this operator, the result is TRUE when the left operand does not have a
value higher than the right operand; otherwise, the result is FALSE.

Up One Level
SQL Overview Syntax
+ (Add)
+ (Positive) expression ! > expression

+ (String Concatenation)
- (Subtract) Arguments
- (Negative)
expression
* (Multiply) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). Both expressions must have implicitly convertible data types.
/ (Divide) The conversion depends on the rules of data type precedence.

% (Modulo)
& (Bitwise AND) Result Types
| (Bitwise OR)
^ (Bitwise Exclusive OR) bit

~ (Bitwise NOT)
= (Equals) Examples
> (Greater Than)
< (Less Than) The following example uses the not greater than comparison operator to find all orders in
the Order Details table of the Northwind database with quantities equal to or less than
>= (Greater Than or Equal To) 10 units.

<= (Less Than or Equal To)


<> (Not Equal To) SELECT * FROM "Order Details" WHERE Quantity !> '10'

!= (Not Equal To)


!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ACOS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |

ALL Trademarks |Privacy Statement

ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_greater_than_.asp (1 of 3) [23/07/2004 12:01:47 p.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_greater_than_.asp (2 of 3) [23/07/2004 12:01:47 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce__not_greater_than_.asp (3 of 3) [23/07/2004 12:01:47 p.m.]


@@IDENTITY (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


@@IDENTITY

Returns the last-inserted identity value.

Syntax

@@IDENTITY

Return Types

numeric

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce___identity.asp?frame=true [23/07/2004 12:05:41 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Library Go MSDN Home > MSDN Library > Enterprise Development > Windows
Server System > Microsoft SQL Server > SQL Server 2000 Windows CE
Advanced Search Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL
Reference for SQL Server CE

SQL Server CE Books Online

Up One Level @@IDENTITY


SQL Overview
+ (Add) Returns the last-inserted identity value.
+ (Positive)
+ (String Concatenation) Syntax
- (Subtract)
- (Negative) @@IDENTITY
* (Multiply)
/ (Divide) Return Types
% (Modulo)
& (Bitwise AND) numeric
| (Bitwise OR)
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
= (Equals)
> (Greater Than)
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
< (Less Than)
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |
>= (Greater Than or Equal To) Privacy Statement
<= (Less Than or Equal To)
<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS
ACOS
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce___identity.asp (1 of 3) [23/07/2004 12:21:56 p.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce___identity.asp (2 of 3) [23/07/2004 12:21:56 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce___identity.asp (3 of 3) [23/07/2004 12:21:56 p.m.]


ABS (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


ABS

Returns the absolute, positive value of the given numeric expression.

Syntax

ABS ( numeric_expression )

Arguments

numeric_expression
Is an expression of the exact numeric or approximate numeric data type categories, or types that are implicitly convertible to float.

Return Types

Returns the same type as numeric_expression except for the following expressions.

Specified expression Return type


tinyint, smallint int

real/float float

Nonnumeric types that can be implicitly converted to float float

Examples

The following example returns the absolute value of the difference between the units of products in stock and units of products that have been ordered in the
Products table of the Northwind database.

SELECT (UnitsInStock - UnitsOnOrder), ABS(UnitsInStock - UnitsOnOrder)


FROM Products

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_abs_705.asp?frame=true [23/07/2004 12:22:16 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
ABS

Returns the absolute, positive value of the given numeric expression.

Syntax
Up One Level
ABS ( numeric_expression )
SQL Overview
+ (Add)
Arguments
+ (Positive)
+ (String Concatenation) numeric_expression
- (Subtract) Is an expression of the exact numeric or approximate numeric data type categories, or types that are implicitly convertible to float.

- (Negative)
* (Multiply) Return Types
/ (Divide)
Returns the same type as numeric_expression except for the following expressions.
% (Modulo)
& (Bitwise AND)
| (Bitwise OR) Specified expression Return type
tinyint, smallint int
^ (Bitwise Exclusive OR) real/float float

~ (Bitwise NOT) Nonnumeric types that can be implicitly converted to float float

= (Equals)
> (Greater Than) Examples
< (Less Than)
>= (Greater Than or Equal To) The following example returns the absolute value of the difference between the units of products in stock and units of products that have been ordered in the
Products table of the Northwind database.
<= (Less Than or Equal To)
<> (Not Equal To) SELECT (UnitsInStock - UnitsOnOrder), ABS(UnitsInStock - UnitsOnOrder)
!= (Not Equal To) FROM Products

!< (Not Less Than)


!> (Not Greater Than)
@@IDENTITY

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_abs_705.asp (1 of 4) [23/07/2004 12:22:27 p.m.]


Welcome to the MSDN Library

ABS
ACOS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ALL ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_abs_705.asp (2 of 4) [23/07/2004 12:22:27 p.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_abs_705.asp (3 of 4) [23/07/2004 12:22:27 p.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_abs_705.asp (4 of 4) [23/07/2004 12:22:27 p.m.]


ACOS (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


ACOS

Returns the angle, in radians, whose cosine is the given float expression; also called arccosine.

Syntax

ACOS ( float_expression )

Arguments

float_expression
Is an expression of the type float, or of types that can be implicitly converted to float, with a value from -1 through 1. Values outside this
range return NULL and report a domain error.

Return Types

float

Examples

The following example returns the arccosine of the cosine of various angles.

CREATE TABLE Acosine ("COS(0)" float, "COS(PI()/6)" float, "COS(PI()/4)" float, "COS(PI()/3)" float, "COS(PI()/2)" float)
INSERT INTO Acosine VALUES (COS(0), COS(PI()/6), COS(PI()/4), COS(PI()/3), COS(PI()/2))
SELECT ACOS ("COS(0)"), ACOS ("COS(PI()/6)"), ACOS ("COS(PI()/4)"), ACOS ("COS(PI()/3)"), ACOS ("COS(PI()/2)")
FROM Acosine

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_acos.asp?frame=true [23/07/2004 12:24:48 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000
MSDN Library Go Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
ACOS

Returns the angle, in radians, whose cosine is the given float expression; also called arccosine.

Syntax
Up One Level
SQL Overview ACOS ( float_expression )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) float_expression
Is an expression of the type float, or of types that can be implicitly converted to float, with a value from -1
- (Negative) through 1. Values outside this range return NULL and report a domain error.

* (Multiply)
/ (Divide) Return Types
% (Modulo)
float
& (Bitwise AND)
| (Bitwise OR)
^ (Bitwise Exclusive OR) Examples
~ (Bitwise NOT)
The following example returns the arccosine of the cosine of various angles.
= (Equals)
> (Greater Than)
< (Less Than)
CREATE TABLE Acosine ("COS(0)" float, "COS(PI()/6)" float, "COS(PI()/4)" float, "COS(PI()/3)" float,
"COS(PI()/2)" float)

>= (Greater Than or Equal To)


INSERT INTO Acosine VALUES (COS(0), COS(PI()/6), COS(PI()/4), COS(PI()/3), COS(PI()/2))
SELECT ACOS ("COS(0)"), ACOS ("COS(PI()/6)"), ACOS ("COS(PI()/4)"), ACOS ("COS(PI()/3)"), ACOS ("COS(PI()/2)")

<= (Less Than or Equal To)


FROM Acosine

<> (Not Equal To)


!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ABS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

ACOS
ALL
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_acos.asp (1 of 3) [23/07/2004 12:24:57 p.m.]


Welcome to the MSDN Library

COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_acos.asp (2 of 3) [23/07/2004 12:24:57 p.m.]


Welcome to the MSDN Library

REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_acos.asp (3 of 3) [23/07/2004 12:24:57 p.m.]


ALL (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


ALL

Compares a scalar value with a single-column set of values.

Syntax

scalar_expression { = | <> | != | > | >= | !> | < | <= | !< } ALL ( subquery )

Arguments

scalar_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
{ = | <> | != | > | >= | !> | < | <= | !< }
Is a comparison operator.
subquery
Is a subquery that returns a result set of one column. The data type of the returned column must be the same data type as the data type of
scalar_expression.

subquery is a restricted SELECT statement (the ORDER BY clause, the COMPUTE clause, and the INTO keyword are not allowed).

Return Types

bit

Result Value

Returns TRUE when the comparison specified is TRUE for all pairs (scalar_expression, x) where x is a value in the single-column set; otherwise, returns
FALSE.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_all.asp?frame=true [23/07/2004 12:37:43 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


ALL

Compares a scalar value with a single-column set of values.

Up One Level Syntax


SQL Overview
+ (Add) scalar_expression { = | <> | != | > | >= | !> | < | <= | !< } ALL ( subquery )

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
scalar_expression
- (Negative) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE).
* (Multiply) { = | <> | != | > | >= | !> | < | <= | !< }
Is a comparison operator.
/ (Divide) subquery
Is a subquery that returns a result set of one column. The data type of the
% (Modulo) returned column must be the same data type as the data type of
scalar_expression.
& (Bitwise AND)
| (Bitwise OR) subquery is a restricted SELECT statement (the ORDER BY clause, the COMPUTE
clause, and the INTO keyword are not allowed).
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
= (Equals) Return Types
> (Greater Than)
bit
< (Less Than)
>= (Greater Than or Equal To)
<= (Less Than or Equal To) Result Value
<> (Not Equal To)
!= (Not Equal To) Returns TRUE when the comparison specified is TRUE for all pairs (scalar_expression, x)
where x is a value in the single-column set; otherwise, returns FALSE.
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY
ABS
ACOS
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
ALL
ALTER TABLE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_all.asp (1 of 3) [23/07/2004 12:37:54 p.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_all.asp (2 of 3) [23/07/2004 12:37:54 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_all.asp (3 of 3) [23/07/2004 12:37:54 p.m.]


ALTER TABLE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


ALTER TABLE

Modifies a table definition by altering, adding, or dropping columns and constraints.

Syntax

ALTER TABLE table_name


{ [ ALTER COLUMN column_name
{DROP DEFAULT
| SET DEFAULT constant_expression
| IDENTITY [ ( seed , increment ) ]
}
| ADD
{ < column_definition > | < table_constraint > } [ ,...n ]
| DROP
{ [ CONSTRAINT ] constraint_name
| COLUMN column }
] }
< column_definition > ::=
{ column_name data_type }
[ [ DEFAULT constant_expression ]
| IDENTITY [ ( seed , increment ) ]
]
[ROWGUIDCOL]
[ < column_constraint > ] [ ...n ] ]
< column_constraint > ::=
[ NULL | NOT NULL ]
[ CONSTRAINT constraint_name ]
{
| { PRIMARY KEY | UNIQUE }
| REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
}
< table_constraint > ::=
[ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
{ ( column [ ,...n ] ) }
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
}

Arguments

table_name
Is the name of the new table. Table names must conform to the rules for identifiers. table_name must be unique within the database.
table_name can contain a maximum of 128 characters.
ALTER COLUMN
Specifies that the given column is to be changed or altered.
column_name
Is the name of a column in the table. Column names must conform to the rules for identifiers and must be unique in the table.
data_type
Specifies the column data type. For information about data types, see Data Types.
DEFAULT
Specifies the value provided for the column when a value is not explicitly supplied during an insert action. DEFAULT definitions can be applied
to any column except those defined by the IDENTITY property. DEFAULT definitions are removed when the table is dropped. Only a constant
value, such as a character string or a date function, can be used as a default.
IDENTITY
Indicates that the new column is an identity column. When a new row is added to the table, Microsoft® SQL Server™ 2000 Windows® CE
Edition (SQL Server CE) provides a unique, incremental value for the column. Identity columns are commonly used in conjunction with
PRIMARY KEY constraints to serve as the unique row identifier for the table. The IDENTITY property can be assigned only to int columns. Only
one identity column can be created per table. Bound defaults and DEFAULT constraints cannot be used with an identity column. You must
specify both the seed and increment, or neither. If neither is specified, the default is (1,1).
seed
Is the value used for the first row that is loaded into the table.
increment
Is the incremental value added to the identity value of the previous row that is loaded.
ADD
Specifies that one or more column definitions, computed column definitions, or table constraints are added.
DROP { [CONSTRAINT] constraint_name | COLUMN column}

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_alter_table.asp?frame=true (1 of 3) [23/07/2004 12:38:06 p.m.]


ALTER TABLE (SQL Server CE Books Online)

Specifies that constraint_name or column_name is to be removed from the table.


ROWGUIDCOL
Indicates that the new column is a row global unique identifier column. Only one uniqueidentifier column per table can be designated as the
ROWGUIDCOL column. The ROWGUIDCOL property can be assigned only to a uniqueidentifier column.

ROWGUIDCOL automatically generates values for new rows inserted into the table.
NULL | NOT NULL
Are keywords that specify whether null values are allowed in the column. NULL is not strictly a constraint but can be specified in the same
manner as NOT NULL.
CONSTRAINT
Is an optional keyword indicating the beginning of a definition for a PRIMARY KEY, UNIQUE, or FOREIGN KEY constraint. Constraints are special
properties that enforce data integrity and create special types of indexes for the table and its columns.
constraint_name
Is the name of a constraint. constraint_name is optional and must be unique within a database. If constraint_name is not specified, SQL Server
CE generates a constraint name.
PRIMARY KEY
Is a constraint that enforces entity integrity for a given column or columns using a unique index. Only one PRIMARY KEY constraint can be
created per table.
UNIQUE
Is a constraint that provides entity integrity for a given column or columns using a unique index. Columns in a UNIQUE constraint must also be
NOT NULL. A table can have multiple UNIQUE constraints.

Note SQL Server CE can use indexes to enforce PRIMARY KEY and UNIQUE constraints. You should not rely on this behavior nor
try to manipulate any indexes that are created as part of a constraint.

FOREIGN KEY...REFERENCES
Is a constraint that provides referential integrity for the data in the column. FOREIGN KEY constraints require that each value in the column
exists in the specified column in the referenced table.
ref_table
Is the name of the table referenced by the FOREIGN KEY constraint.
( ref_column [ ,...n ] )
Is a column or list of columns from the table referenced by the FOREIGN KEY constraint.
ON DELETE {CASCADE | NO ACTION}
Specifies what action takes place to a row in the table that is created when that row has a referential relationship and the referenced row is
deleted from the parent table. The default is NO ACTION.

If CASCADE is specified, a row is deleted from the referencing table when the corresponding referenced row is deleted from the
parent table. If NO ACTION is specified, SQL Server CE raises an error, and the delete action on the referenced row in the parent
table is rolled back.

For example, in the Northwind database, the Orders table has a referential relationship with the Customers table: the
Orders.CustomerID foreign key references the Customers.CustomerID primary key.

If a DELETE statement is executed on a row in the Customers table and an ON DELETE CASCADE action is specified for
Orders.CustomerID, SQL Server CE checks for one or more dependent rows in the Orders table. If any exist, the dependent
rows in the Orders table are deleted, as well as the row referenced in the Customers table.

Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls back the delete action on the row in the Customers
table when there is at least one row in the Orders table that references it.

ON UPDATE {CASCADE | NO ACTION}


Specifies what action takes place to a row in the table created, when that row has a referential relationship and the referenced row is updated
in the parent table. The default is NO ACTION.

If CASCADE is specified, the row is updated in the referencing table if the corresponding referenced row is updated in the parent
table. If NO ACTION is specified, SQL Server CE raises an error, and the update action on the referenced row in the parent table is
rolled back.

For example, in the Northwind database, the Orders table has a referential relationship with the Customers table: the
Orders.CustomerID foreign key references the Customers.CustomerID primary key.

If an UPDATE statement is executed on a row in the Customers table and an ON UPDATE CASCADE action is specified for
Orders.CustomerID, SQL Server CE checks for one or more dependent rows in the Orders table. If any exist, the dependent
rows in the Orders table are updated, as well as the row referenced in the Customers table.

Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls back the update action on the referenced row in the
Customers table when there is at least one row in the Orders table that references it.

column
Is a column or list of columns, in parentheses, used in table constraints to indicate the columns used in the definition of the constraint.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_alter_table.asp?frame=true (2 of 3) [23/07/2004 12:38:06 p.m.]


ALTER TABLE (SQL Server CE Books Online)

n
Is a placeholder indicating that the preceding item can be repeated n number of times.

Examples

A. Changing the seed and increment values on the identity column

The following example changes the seed and increment values on the identity column.

CREATE TABLE MyCustomers (CustID INTEGER IDENTITY (100,1) PRIMARY KEY, CompanyName NvarChar (50))
INSERT INTO MyCustomers (CompanyName) VALUES ('A. Datum Corporation')
ALTER TABLE MyCustomers ALTER COLUMN CustId IDENTITY (200, 2)

B. Adding a default value to the identity column

The following example modifies the CompanyName column so that it has a default value.

ALTER TABLE MyCustomers ALTER COLUMN CompanyName SET DEFAULT 'A. Datum Corporation'

C. Dropping a default value from the identity column

The following example modifies the CompanyName column so that it does not have a default value.

ALTER TABLE MyCustomers ALTER COLUMN CompanyName DROP DEFAULT

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_alter_table.asp?frame=true (3 of 3) [23/07/2004 12:38:06 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL
MSDN Library Go Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server
CE
Advanced Search

SQL Server CE Books Online


ALTER TABLE

Modifies a table definition by altering, adding, or dropping columns and constraints.

Up One Level Syntax


SQL Overview
+ (Add) ALTER TABLE table_name
{ [ ALTER COLUMN column_name
+ (Positive) {DROP DEFAULT
| SET DEFAULT constant_expression
+ (String Concatenation) | IDENTITY [ ( seed , increment ) ]
}
- (Subtract) | ADD
{ < column_definition > | < table_constraint > } [ ,...n ]
- (Negative) | DROP
{ [ CONSTRAINT ] constraint_name
* (Multiply) ] }
| COLUMN column }

/ (Divide) < column_definition > ::=


{ column_name data_type }
% (Modulo) [ [ DEFAULT constant_expression ]
| IDENTITY [ ( seed , increment ) ]
& (Bitwise AND) ]
[ROWGUIDCOL]
| (Bitwise OR) [ < column_constraint > ] [ ...n ] ]
< column_constraint > ::=
^ (Bitwise Exclusive OR) [ NULL | NOT NULL ]
[ CONSTRAINT constraint_name ]
~ (Bitwise NOT) {
| { PRIMARY KEY | UNIQUE }
= (Equals) | REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
> (Greater Than) }
[ ON UPDATE { CASCADE | NO ACTION } ]

< (Less Than) < table_constraint > ::=


[ CONSTRAINT constraint_name ]
>= (Greater Than or Equal To) { [ { PRIMARY KEY | UNIQUE }
{ ( column [ ,...n ] ) }
<= (Less Than or Equal To) | FOREIGN KEY
[ ( column [ ,...n ] ) ]
<> (Not Equal To) REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
!= (Not Equal To) }
[ ON UPDATE { CASCADE | NO ACTION } ]

!< (Not Less Than)


!> (Not Greater Than) Arguments
@@IDENTITY
ABS table_name
Is the name of the new table. Table names must conform to the rules for identifiers.
ACOS table_name must be unique within the database. table_name can contain a maximum of 128
characters.
ALL ALTER COLUMN
Specifies that the given column is to be changed or altered.
ALTER TABLE column_name
Is the name of a column in the table. Column names must conform to the rules for identifiers
AND and must be unique in the table.
data_type
ASIN Specifies the column data type. For information about data types, see Data Types.
DEFAULT
ATAN Specifies the value provided for the column when a value is not explicitly supplied during an
insert action. DEFAULT definitions can be applied to any column except those defined by the
ATN2 IDENTITY property. DEFAULT definitions are removed when the table is dropped. Only a
constant value, such as a character string or a date function, can be used as a default.
AVG IDENTITY
Indicates that the new column is an identity column. When a new row is added to the table,
BETWEEN Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides a unique,
incremental value for the column. Identity columns are commonly used in conjunction with

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_alter_table.asp (1 of 3) [23/07/2004 12:38:18 p.m.]


Welcome to the MSDN Library

PRIMARY KEY constraints to serve as the unique row identifier for the table. The IDENTITY
CASE property can be assigned only to int columns. Only one identity column can be created per
table. Bound defaults and DEFAULT constraints cannot be used with an identity column. You
CEILING must specify both the seed and increment, or neither. If neither is specified, the default is (1,1).
CHARINDEX seed
Is the value used for the first row that is loaded into the table.
COALESCE increment
Is the incremental value added to the identity value of the previous row that is loaded.
COLLATE ADD
Specifies that one or more column definitions, computed column definitions, or table constraints
CONVERT are added.
DROP { [CONSTRAINT] constraint_name | COLUMN column}
COS ROWGUIDCOL
Specifies that constraint_name or column_name is to be removed from the table.

COT Indicates that the new column is a row global unique identifier column. Only one
uniqueidentifier column per table can be designated as the ROWGUIDCOL column. The
COUNT ROWGUIDCOL property can be assigned only to a uniqueidentifier column.

CREATE DATABASE
ROWGUIDCOL automatically generates values for new rows inserted into the table.
CREATE INDEX NULL | NOT NULL
Are keywords that specify whether null values are allowed in the column. NULL is not strictly a
CREATE TABLE constraint but can be specified in the same manner as NOT NULL.
DATALENGTH CONSTRAINT
Is an optional keyword indicating the beginning of a definition for a PRIMARY KEY, UNIQUE, or
Data Types FOREIGN KEY constraint. Constraints are special properties that enforce data integrity and
create special types of indexes for the table and its columns.
DATEADD constraint_name
Is the name of a constraint. constraint_name is optional and must be unique within a database.
DATEDIFF PRIMARY KEY
If constraint_name is not specified, SQL Server CE generates a constraint name.

DATENAME Is a constraint that enforces entity integrity for a given column or columns using a unique index.
Only one PRIMARY KEY constraint can be created per table.
DATEPART UNIQUE
Is a constraint that provides entity integrity for a given column or columns using a unique index.
DDL Statements Columns in a UNIQUE constraint must also be NOT NULL. A table can have multiple UNIQUE
constraints.
DEGREES
DELETE Note SQL Server CE can use indexes to enforce PRIMARY KEY and UNIQUE
constraints. You should not rely on this behavior nor try to manipulate any indexes
DML Statements that are created as part of a constraint.

DROP INDEX
DROP TABLE FOREIGN KEY...REFERENCES
Is a constraint that provides referential integrity for the data in the column. FOREIGN KEY
EXISTS constraints require that each value in the column exists in the specified column in the
referenced table.
EXP ref_table
Is the name of the table referenced by the FOREIGN KEY constraint.
Expressions ( ref_column [ ,...n ] )
Is a column or list of columns from the table referenced by the FOREIGN KEY constraint.
FLOOR ON DELETE {CASCADE | NO ACTION}
Specifies what action takes place to a row in the table that is created when that row has a
FROM Clause referential relationship and the referenced row is deleted from the parent table. The default is
NO ACTION.
Functions
GETDATE If CASCADE is specified, a row is deleted from the referencing table when the
corresponding referenced row is deleted from the parent table. If NO ACTION is
GROUP BY Clause specified, SQL Server CE raises an error, and the delete action on the referenced
row in the parent table is rolled back.
HAVING Clause
IDENTITY (Property) For example, in the Northwind database, the Orders table has a referential
IN relationship with the Customers table: the Orders.CustomerID foreign key
references the Customers.CustomerID primary key.
Information Schema
INSERT If a DELETE statement is executed on a row in the Customers table and an ON
DELETE CASCADE action is specified for Orders.CustomerID, SQL Server CE
IS [NOT] NULL checks for one or more dependent rows in the Orders table. If any exist, the
dependent rows in the Orders table are deleted, as well as the row referenced in
LEN the Customers table.

LIKE
Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls back
LOG the delete action on the row in the Customers table when there is at least one row
in the Orders table that references it.
LOG10
LOWER ON UPDATE {CASCADE | NO ACTION}
LTRIM Specifies what action takes place to a row in the table created, when that row has a referential
relationship and the referenced row is updated in the parent table. The default is NO ACTION.
MAX
MIN If CASCADE is specified, the row is updated in the referencing table if the
corresponding referenced row is updated in the parent table. If NO ACTION is
NCHAR specified, SQL Server CE raises an error, and the update action on the referenced
row in the parent table is rolled back.
NEWID
NOT For example, in the Northwind database, the Orders table has a referential
relationship with the Customers table: the Orders.CustomerID foreign key
Operators references the Customers.CustomerID primary key.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_alter_table.asp (2 of 3) [23/07/2004 12:38:18 p.m.]


Welcome to the MSDN Library

OR If an UPDATE statement is executed on a row in the Customers table and an ON


UPDATE CASCADE action is specified for Orders.CustomerID, SQL Server CE
ORDER BY Clause checks for one or more dependent rows in the Orders table. If any exist, the
dependent rows in the Orders table are updated, as well as the row referenced in
PATINDEX the Customers table.

PI
POWER Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls back
the update action on the referenced row in the Customers table when there is at
RADIANS least one row in the Orders table that references it.

RAND
column
REPLACE Is a column or list of columns, in parentheses, used in table constraints to indicate the columns
used in the definition of the constraint.
REPLICATE n
Is a placeholder indicating that the preceding item can be repeated n number of times.
Reserved Words
ROUND Examples
RTRIM
SELECT Statement A. Changing the seed and increment values on the identity column
SIGN
SIN The following example changes the seed and increment values on the identity column.

SOME | ANY
SPACE CREATE TABLE MyCustomers (CustID INTEGER IDENTITY (100,1) PRIMARY KEY, CompanyName NvarChar (50))
INSERT INTO MyCustomers (CompanyName) VALUES ('A. Datum Corporation')
SQRT ALTER TABLE MyCustomers ALTER COLUMN CustId IDENTITY (200, 2)

STR
STUFF B. Adding a default value to the identity column
SUBSTRING
The following example modifies the CompanyName column so that it has a default value.
SUM
TAN
UNICODE
ALTER TABLE MyCustomers ALTER COLUMN CompanyName SET DEFAULT 'A. Datum Corporation'

UNION
C. Dropping a default value from the identity column
UPDATE
UPPER The following example modifies the CompanyName column so that it does not have a default value.
WHERE Clause
ALTER TABLE MyCustomers ALTER COLUMN CompanyName DROP DEFAULT

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_alter_table.asp (3 of 3) [23/07/2004 12:38:18 p.m.]


AND (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


AND

Combines two Boolean expressions and returns TRUE when both expressions are TRUE. When more than one logical operator is used in a statement, AND
operators are evaluated first. You can change the order of evaluation by using parentheses.

Syntax

Boolean_expression AND boolean_expression

Arguments

Boolean_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) that returns a Boolean value: TRUE, FALSE, or
UNKNOWN.

Result Types

bit

Result Value

Returns TRUE when both expressions are TRUE.

Examples

The following example uses AND to get the total cost of a specific order for a particular product in the Northwind database.

SELECT UnitPrice * Quantity AS "Total Cost" FROM "Order Details" WHERE ProductID = '11' AND OrderID = '10248'

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_and.asp?frame=true [23/07/2004 12:38:41 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000
MSDN Library Go Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
AND

Combines two Boolean expressions and returns TRUE when both expressions are TRUE. When more than one logical
operator is used in a statement, AND operators are evaluated first. You can change the order of evaluation by using
parentheses.

Up One Level Syntax


SQL Overview
+ (Add) Boolean_expression AND boolean_expression

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) Boolean_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) that returns a
* (Multiply) Boolean value: TRUE, FALSE, or UNKNOWN.

/ (Divide)
% (Modulo) Result Types
& (Bitwise AND)
bit
| (Bitwise OR)
^ (Bitwise Exclusive OR)
~ (Bitwise NOT) Result Value
= (Equals)
Returns TRUE when both expressions are TRUE.
> (Greater Than)
< (Less Than)
>= (Greater Than or Equal To) Examples
<= (Less Than or Equal To)
The following example uses AND to get the total cost of a specific order for a particular product in the Northwind
<> (Not Equal To) database.

!= (Not Equal To)


!< (Not Less Than) SELECT UnitPrice * Quantity AS "Total Cost" FROM "Order Details" WHERE ProductID = '11' AND OrderID = '10248'

!> (Not Greater Than)


@@IDENTITY
ABS
ACOS
ALL Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
ALTER TABLE
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_and.asp (1 of 3) [23/07/2004 12:38:55 p.m.]


Welcome to the MSDN Library

COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_and.asp (2 of 3) [23/07/2004 12:38:55 p.m.]


Welcome to the MSDN Library

REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_and.asp (3 of 3) [23/07/2004 12:38:55 p.m.]


ASIN (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


ASIN

Returns the angle, in radians, whose sine is the given float expression (also called arcsine).

Syntax

ASIN ( float_expression )

Arguments

float_expression
Is an expression of the type float, or of types that can be implicitly converted to float, with a value from -1 through 1. Values outside this
range report a domain error.

Return Types

float

Examples

The following example returns the arcsine of the sine of various angles.

CREATE TABLE Asine ("SIN(0)" float, "SIN(PI()/6)" float, "SIN(PI()/4)" float, "SIN(PI()/3)" float, "SIN(PI()/2)" float)
INSERT INTO Asine VALUES (SIN(0), SIN(PI()/6), SIN(PI()/4), SIN(PI()/3), SIN(PI()/2))
SELECT ASIN("SIN(0)"), ASIN("SIN(PI()/6)"), ASIN("SIN(PI()/4)"), ASIN("SIN(PI()/3)"), ASIN("SIN(PI()/2)")
FROM Asine

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_asin.asp?frame=true [23/07/2004 12:39:16 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server
MSDN Library Go 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
ASIN

Returns the angle, in radians, whose sine is the given float expression (also called arcsine).

Syntax
Up One Level
SQL Overview ASIN ( float_expression )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) float_expression
Is an expression of the type float, or of types that can be implicitly converted to float, with a value from -
- (Negative) 1 through 1. Values outside this range report a domain error.

* (Multiply)
/ (Divide) Return Types
% (Modulo)
float
& (Bitwise AND)
| (Bitwise OR)
^ (Bitwise Exclusive OR) Examples
~ (Bitwise NOT)
The following example returns the arcsine of the sine of various angles.
= (Equals)
> (Greater Than)
< (Less Than)
CREATE TABLE Asine ("SIN(0)" float, "SIN(PI()/6)" float, "SIN(PI()/4)" float, "SIN(PI()/3)" float,
"SIN(PI()/2)" float)

>= (Greater Than or Equal To)


INSERT INTO Asine VALUES (SIN(0), SIN(PI()/6), SIN(PI()/4), SIN(PI()/3), SIN(PI()/2))
SELECT ASIN("SIN(0)"), ASIN("SIN(PI()/6)"), ASIN("SIN(PI()/4)"), ASIN("SIN(PI()/3)"), ASIN("SIN(PI()/2)")

<= (Less Than or Equal To)


FROM Asine

<> (Not Equal To)


!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
@@IDENTITY Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ABS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

ACOS
ALL
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_asin.asp (1 of 3) [23/07/2004 12:39:31 p.m.]


Welcome to the MSDN Library

COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_asin.asp (2 of 3) [23/07/2004 12:39:31 p.m.]


Welcome to the MSDN Library

RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_asin.asp (3 of 3) [23/07/2004 12:39:31 p.m.]


ATAN (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


ATAN

Returns the angle in radians whose tangent is the given float expression (also called arctangent).

Syntax

ATAN ( float_expression )

Arguments

float_expression
Is an expression of the type float, or of types that can be implicitly converted to float.

Return Types

float

Examples

The following example returns the arctangent of the tangent of various angles.

CREATE TABLE Atangent ("TAN(0)" float, "TAN(PI()/6)" float, "TAN(PI()/4)" float, "TAN(PI()/3)" float, "TAN(PI()/2)" float)
INSERT INTO Atangent VALUES (TAN(0), TAN(PI()/6), TAN(PI()/4), TAN(PI()/3), TAN(PI()/2))
SELECT ATAN("TAN(0)"), ATAN("TAN(PI()/6)"), ATAN("TAN(PI()/4)"), ATAN("TAN(PI()/3)"), ATAN("TAN(PI()/2)")
FROM Atangent

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_atan.asp?frame=true [23/07/2004 12:42:18 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server
MSDN Library Go 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
ATAN

Returns the angle in radians whose tangent is the given float expression (also called arctangent).

Syntax
Up One Level
SQL Overview ATAN ( float_expression )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) float_expression
Is an expression of the type float, or of types that can be implicitly converted to float.
- (Negative)
* (Multiply) Return Types
/ (Divide)
% (Modulo) float

& (Bitwise AND)


| (Bitwise OR) Examples
^ (Bitwise Exclusive OR)
~ (Bitwise NOT) The following example returns the arctangent of the tangent of various angles.

= (Equals)
> (Greater Than) CREATE TABLE Atangent ("TAN(0)" float, "TAN(PI()/6)" float, "TAN(PI()/4)" float, "TAN(PI()/3)" float,

< (Less Than)


"TAN(PI()/2)" float)
INSERT INTO Atangent VALUES (TAN(0), TAN(PI()/6), TAN(PI()/4), TAN(PI()/3), TAN(PI()/2))

>= (Greater Than or Equal To)


SELECT ATAN("TAN(0)"), ATAN("TAN(PI()/6)"), ATAN("TAN(PI()/4)"), ATAN("TAN(PI()/3)"), ATAN("TAN(PI()/2)")
FROM Atangent

<= (Less Than or Equal To)


<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than) Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
@@IDENTITY
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
ABS
ACOS
ALL
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_atan.asp (1 of 3) [23/07/2004 12:42:26 p.m.]


Welcome to the MSDN Library

COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_atan.asp (2 of 3) [23/07/2004 12:42:26 p.m.]


Welcome to the MSDN Library

RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_atan.asp (3 of 3) [23/07/2004 12:42:26 p.m.]


AVG (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


AVG

Returns the average of the values in a group. Null values are ignored.

Syntax

AVG ( [ ALL ] expression )

Arguments

ALL
Applies the aggregate function to all values. ALL is the default.
expression
Is an expression of the exact numeric or approximate numeric data type categories, except for the bit data type. Aggregate functions and subqueries
are not permitted.

Return Types

The return type is determined by the type of the evaluated result of expression.

Expression result Return type


integer category int

numeric category (p, s) numeric(28, s) divided by numeric(10, 0)

money category money

float and real category float

Examples

The following example uses the Orders table in the Northwind database. The example determines the average freight shipped to a company that has a
CustomerID of VINET in 1996.

--Get all OrderIDs for the VINET CustomerID.


SELECT OrderID, ShippedDate FROM Orders WHERE CustomerID = 'VINET'

This is the result set:

OrderID ShippedDate
----------------------------------
10248 1996-07-16 00:00:00.000
10274 1996-08-16 00:00:00.000
10295 1996-09-10 00:00:00.000
10737 1997-11-18 00:00:00.000
10739 1997-11-17 00:00:00.000

--Get the average freight for all orders shipped in 1996.


SELECT AVG(Freight) AS "Average 1996 Freight" FROM Orders WHERE CustomerID = 'VINET' AND OrderID IN (10248, 10274, 10295)

This is the result set:

Average 1996 Freight


--------------------
13.18

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_avg.asp?frame=true (1 of 2) [23/07/2004 12:42:40 p.m.]


AVG (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_avg.asp?frame=true (2 of 2) [23/07/2004 12:42:40 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
AVG

Returns the average of the values in a group. Null values are ignored.

Syntax
Up One Level
AVG ( [ ALL ] expression )
SQL Overview
+ (Add)
Arguments
+ (Positive)
+ (String Concatenation) ALL
- (Subtract) expression
Applies the aggregate function to all values. ALL is the default.

- (Negative) Is an expression of the exact numeric or approximate numeric data type categories, except for the bit data type. Aggregate functions and subqueries
are not permitted.
* (Multiply)
/ (Divide) Return Types
% (Modulo)
& (Bitwise AND) The return type is determined by the type of the evaluated result of expression.

| (Bitwise OR)
^ (Bitwise Exclusive OR) Expression result Return type
~ (Bitwise NOT) integer category int

= (Equals) numeric category (p, s) numeric(28, s) divided by numeric(10, 0)

money category money


> (Greater Than) float and real category float

< (Less Than)


>= (Greater Than or Equal To) Examples
<= (Less Than or Equal To)
<> (Not Equal To) The following example uses the Orders table in the Northwind database. The example determines the average freight shipped to a company that has a
CustomerID of VINET in 1996.
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than)
--Get all OrderIDs for the VINET CustomerID.
SELECT OrderID, ShippedDate FROM Orders WHERE CustomerID = 'VINET'

@@IDENTITY
This is the result set:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_avg.asp (1 of 4) [23/07/2004 12:42:51 p.m.]


Welcome to the MSDN Library

ABS OrderID ShippedDate


ACOS ----------------------------------
10248 1996-07-16 00:00:00.000
ALL 10274
10295
1996-08-16 00:00:00.000
1996-09-10 00:00:00.000
ALTER TABLE 10737
10739
1997-11-18 00:00:00.000
1997-11-17 00:00:00.000
AND --Get the average freight for all orders shipped in 1996.
ASIN SELECT AVG(Freight) AS "Average 1996 Freight" FROM Orders WHERE CustomerID = 'VINET' AND OrderID IN (10248,
10274, 10295)
ATAN
ATN2 This is the result set:

AVG
BETWEEN Average 1996 Freight
--------------------
CASE 13.18

CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

COS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_avg.asp (2 of 4) [23/07/2004 12:42:51 p.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_avg.asp (3 of 4) [23/07/2004 12:42:51 p.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_avg.asp (4 of 4) [23/07/2004 12:42:51 p.m.]


BETWEEN (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


BETWEEN

Specifies a range to test.

Syntax

test_expression [ NOT ] BETWEEN begin_expression AND end_expression

Arguments

test_expression
Is the expression to test for in the range defined by begin_expression and end_expression. test_expression must be the same data type as
both begin_expression and end_expression.
NOT
Specifies that the result of the predicate be negated.
begin_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE). begin_expression must be the same data
type as both test_expression and end_expression.
end_expression
Is any valid expression in SQL Server CE. end_expression must be the same data type as both test_expression and begin_expression.
AND
Acts as a placeholder indicating that test_expression should be within the range indicated by begin_expression and end_expression.

Result Types

bit

Result Value

BETWEEN returns TRUE if the value of test_expression is greater than or equal to the value of begin_expression and less than or equal to the value of
end_expression.

NOT BETWEEN returns TRUE if the value of test_expression is less than the value of begin_expression or greater than the value of end_expression.

Remarks

To specify an exclusive range, use the greater than (>) and less than (<) operators. If any input to the BETWEEN or NOT BETWEEN predicate is NULL, the
result is UNKNOWN.

Examples

The following example identifies the products in the Northwind database with 35 or fewer units in stock.

SELECT ProductID, ProductName FROM Products WHERE UnitsInStock BETWEEN '0' AND '35'

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_between.asp?frame=true (1 of 2) [23/07/2004 12:43:08 p.m.]


BETWEEN (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_between.asp?frame=true (2 of 2) [23/07/2004 12:43:08 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


BETWEEN

Specifies a range to test.

Up One Level Syntax


SQL Overview
+ (Add) test_expression [ NOT ] BETWEEN begin_expression AND end_expression

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
test_expression
- (Negative) Is the expression to test for in the range defined by begin_expression and
end_expression. test_expression must be the same data type as both
* (Multiply) begin_expression and end_expression.
NOT
/ (Divide) Specifies that the result of the predicate be negated.
begin_expression
% (Modulo) Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE). begin_expression must be the same data type as both
& (Bitwise AND) test_expression and end_expression.
end_expression
| (Bitwise OR) Is any valid expression in SQL Server CE. end_expression must be the same
data type as both test_expression and begin_expression.
^ (Bitwise Exclusive OR) AND
Acts as a placeholder indicating that test_expression should be within the range
~ (Bitwise NOT) indicated by begin_expression and end_expression.

= (Equals)
> (Greater Than) Result Types
< (Less Than)
>= (Greater Than or Equal To) bit

<= (Less Than or Equal To)


<> (Not Equal To) Result Value
!= (Not Equal To)
!< (Not Less Than) BETWEEN returns TRUE if the value of test_expression is greater than or equal to the value
of begin_expression and less than or equal to the value of end_expression.
!> (Not Greater Than)
@@IDENTITY NOT BETWEEN returns TRUE if the value of test_expression is less than the value of
ABS begin_expression or greater than the value of end_expression.

ACOS
ALL Remarks
ALTER TABLE
AND To specify an exclusive range, use the greater than (>) and less than (<) operators. If any
input to the BETWEEN or NOT BETWEEN predicate is NULL, the result is UNKNOWN.
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_between.asp (1 of 3) [23/07/2004 12:43:24 p.m.]


Welcome to the MSDN Library

ATAN Examples
ATN2
AVG The following example identifies the products in the Northwind database with 35 or fewer
units in stock.
BETWEEN
CASE SELECT ProductID, ProductName FROM Products WHERE UnitsInStock BETWEEN '0' AND '35'
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
COS
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
COT Trademarks |Privacy Statement
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_between.asp (2 of 3) [23/07/2004 12:43:24 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_between.asp (3 of 3) [23/07/2004 12:43:24 p.m.]


CASE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CASE

Evaluates a list of conditions and returns one of multiple possible result expressions.

CASE has two formats:

● The simple CASE function compares an expression to a set of simple expressions to determine the result.
● The searched CASE function evaluates a set of Boolean expressions to determine the result.

Both formats support an optional ELSE argument.

Syntax

Simple CASE function:

CASE input_expression
WHEN when_expression THEN result_expression
[ ...n ]
[
ELSE else_result_expression
]
END

Searched CASE function:

CASE
WHEN Boolean_expression THEN result_expression
[ ...n ]
[
ELSE else_result_expression
]
END

Arguments

input_expression
Is the expression evaluated when using the simple CASE format. input_expression is any valid expression in Microsoft® SQL Server™ 2000
Windows® CE Edition (SQL Server CE).
WHEN when_expression
Is a simple expression to which input_expression is compared when using the simple CASE format. when_expression is any valid SQL Server
expression. The data types of input_expression and each when_expression must be the same or must be implicitly converted.
n
Is a placeholder indicating that multiple WHEN when_expression THEN result_expression clauses, or multiple WHEN Boolean_expression THEN
result_expression clauses can be used.
THEN result_expression
Is the expression returned when input_expression equals when_expression evaluates to TRUE, or Boolean_expression evaluates to TRUE.
result expression is any valid SQL Server expression.
ELSE else_result_expression
Is the expression returned if no comparison operation evaluates to TRUE. If this argument is omitted and no comparison operation evaluates to
TRUE, CASE returns NULL. else_result_expression is any valid SQL Server expression. The data types of else_result_expression and any
result_expression must be the same or must be an implicit conversion.
WHEN Boolean_expression
Is the Boolean expression evaluated when using the searched CASE format. Boolean_expression is any valid Boolean expression.

Result Types

Returns the highest precedence type from the set of types in result_expressions and the optional else_result_expression.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_case.asp?frame=true (1 of 2) [23/07/2004 12:45:26 p.m.]


CASE (SQL Server CE Books Online)

Result Values

Simple CASE function:

● Evaluates input_expression, and then, in the order specified, evaluates input_expression = when_expression for each WHEN clause.
● Returns the result_expression of the first (input_expression = when_expression) that evaluates to TRUE.
● If no input_expression = when_expression evaluates to TRUE, else_result_expression is returned if an ELSE clause is specified, or NULL if no ELSE clause is specified.

Searched CASE function:

● Evaluates, in the order specified, Boolean_expression for each WHEN clause.


● Returns result_expression of the first Boolean_expression that evaluates to TRUE.
● If no Boolean_expression evaluates to TRUE, else_result_expression is returned if an ELSE clause is specified, or NULL if no ELSE clause is specified.

Examples

The following example returns the mode of shipping used for orders placed in the Northwind database.

SELECT ShipVia, CASE ShipVia


WHEN 1 THEN 'Speedy Express'
WHEN 2 THEN 'United Package'
WHEN 3 THEN 'Federal Shipping'
ELSE 'Unknown'
END
FROM Orders

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_case.asp?frame=true (2 of 2) [23/07/2004 12:45:26 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


CASE

Evaluates a list of conditions and returns one of multiple possible result expressions.

CASE has two formats:


Up One Level
SQL Overview
The simple CASE function compares an expression to a set of simple expressions to determine the result.
+ (Add)

● The searched CASE function evaluates a set of Boolean expressions to determine the result.

+ (Positive)
Both formats support an optional ELSE argument.
+ (String Concatenation)
- (Subtract)
- (Negative) Syntax
* (Multiply)
Simple CASE function:
/ (Divide)
% (Modulo)
CASE input_expression
& (Bitwise AND) WHEN when_expression THEN result_expression
[ ...n ]
| (Bitwise OR) [
ELSE else_result_expression
^ (Bitwise Exclusive OR) ]
END
~ (Bitwise NOT)
= (Equals) Searched CASE function:

> (Greater Than)


< (Less Than) CASE

>= (Greater Than or Equal To)


WHEN Boolean_expression THEN result_expression
[ ...n ]

<= (Less Than or Equal To)


[
ELSE else_result_expression

<> (Not Equal To)


]
END

!= (Not Equal To)


!< (Not Less Than) Arguments
!> (Not Greater Than)
@@IDENTITY input_expression
Is the expression evaluated when using the simple CASE format.
ABS input_expression is any valid expression in Microsoft® SQL Server™ 2000
Windows® CE Edition (SQL Server CE).
ACOS WHEN when_expression
Is a simple expression to which input_expression is compared when using the
ALL simple CASE format. when_expression is any valid SQL Server expression. The
data types of input_expression and each when_expression must be the same or
ALTER TABLE must be implicitly converted.
n
AND Is a placeholder indicating that multiple WHEN when_expression THEN
result_expression clauses, or multiple WHEN Boolean_expression THEN
ASIN result_expression clauses can be used.
THEN result_expression
Is the expression returned when input_expression equals when_expression

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_case.asp (1 of 3) [23/07/2004 12:45:35 p.m.]


Welcome to the MSDN Library

evaluates to TRUE, or Boolean_expression evaluates to TRUE. result expression


ATAN is any valid SQL Server expression.
ELSE else_result_expression
ATN2 Is the expression returned if no comparison operation evaluates to TRUE. If this
AVG argument is omitted and no comparison operation evaluates to TRUE, CASE
returns NULL. else_result_expression is any valid SQL Server expression. The
BETWEEN data types of else_result_expression and any result_expression must be the
same or must be an implicit conversion.
CASE WHEN Boolean_expression
Is the Boolean expression evaluated when using the searched CASE format.
CEILING Boolean_expression is any valid Boolean expression.

CHARINDEX
Result Types
COALESCE
COLLATE
Returns the highest precedence type from the set of types in result_expressions and the
CONVERT optional else_result_expression.

COS
COT Result Values
COUNT
CREATE DATABASE Simple CASE function:

CREATE INDEX
CREATE TABLE ● Evaluates input_expression, and then, in the order specified, evaluates input_expression = when_expression for
each WHEN clause.
Returns the result_expression of the first (input_expression = when_expression) that evaluates to TRUE.
DATALENGTH

● If no input_expression = when_expression evaluates to TRUE, else_result_expression is returned if an ELSE clause


is specified, or NULL if no ELSE clause is specified.

Data Types
DATEADD Searched CASE function:

DATEDIFF
DATENAME ●


Evaluates, in the order specified, Boolean_expression for each WHEN clause.
Returns result_expression of the first Boolean_expression that evaluates to TRUE.
If no Boolean_expression evaluates to TRUE, else_result_expression is returned if an ELSE clause is specified, or

DATEPART

NULL if no ELSE clause is specified.

DDL Statements
DEGREES Examples
DELETE
The following example returns the mode of shipping used for orders placed in the
DML Statements Northwind database.

DROP INDEX
DROP TABLE SELECT ShipVia, CASE ShipVia
WHEN 1 THEN 'Speedy Express'
EXISTS WHEN 2 THEN 'United Package'
WHEN 3 THEN 'Federal Shipping'
EXP ELSE 'Unknown'
END
Expressions FROM Orders

FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

HAVING Clause ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
IDENTITY (Property) Trademarks |Privacy Statement

IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_case.asp (2 of 3) [23/07/2004 12:45:35 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_case.asp (3 of 3) [23/07/2004 12:45:35 p.m.]


CEILING (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CEILING

Returns the smallest integer that is greater than, or equal to, the given numeric expression.

Syntax

CEILING ( numeric_expression )

Arguments

numeric_expression
Is an expression of the exact numeric or approximate numeric data type categories, or types that is implicitly convertible to float (except for the bit
data type).

Return Types

Returns the same type as numeric_expression except for the following expressions.

Specified expression Return type


tinyint, smallint int

real/float float

Nonnumeric types that can be implicitly converted to float float

Examples

This example uses the CEILING function to round off the unit price for products in the Northwind database that are priced more than 100 dollars.

SELECT OrderID, UnitPrice, CEILING (UnitPrice) AS "CEILING"


FROM "Order Details"
WHERE UnitPrice > 100
ORDER BY UnitPrice

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_ceiling.asp?frame=true [23/07/2004 12:45:55 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
CEILING

Returns the smallest integer that is greater than, or equal to, the given numeric expression.

Syntax
Up One Level
CEILING ( numeric_expression )
SQL Overview
+ (Add)
Arguments
+ (Positive)
+ (String Concatenation) numeric_expression
- (Subtract) Is an expression of the exact numeric or approximate numeric data type categories, or types that is implicitly convertible to float (except for the bit
data type).
- (Negative)
* (Multiply) Return Types
/ (Divide)
% (Modulo) Returns the same type as numeric_expression except for the following expressions.

& (Bitwise AND)


| (Bitwise OR) Specified expression Return type
^ (Bitwise Exclusive OR) tinyint, smallint int

~ (Bitwise NOT) real/float float

Nonnumeric types that can be implicitly converted to float float

= (Equals)
> (Greater Than)
Examples
< (Less Than)
>= (Greater Than or Equal To)
This example uses the CEILING function to round off the unit price for products in the Northwind database that are priced more than 100 dollars.
<= (Less Than or Equal To)
<> (Not Equal To) SELECT OrderID, UnitPrice, CEILING (UnitPrice) AS "CEILING"
!= (Not Equal To) FROM "Order Details"
WHERE UnitPrice > 100
!< (Not Less Than) ORDER BY UnitPrice

!> (Not Greater Than)


@@IDENTITY

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_ceiling.asp (1 of 4) [23/07/2004 12:46:06 p.m.]


Welcome to the MSDN Library

ABS
ACOS Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

ALL ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
ALTER TABLE
AND
ASIN
ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_ceiling.asp (2 of 4) [23/07/2004 12:46:06 p.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_ceiling.asp (3 of 4) [23/07/2004 12:46:06 p.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_ceiling.asp (4 of 4) [23/07/2004 12:46:06 p.m.]


CHARINDEX (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CHARINDEX

Returns the starting position of the specified expression in a character string.

Syntax

CHARINDEX ( expression1 , expression2 [ , start_location ] )

Arguments

expression1
Is an expression containing the sequence of characters to be found. expression1 is an expression of the ntext type or a data type that can be
implicitly converted to nvarchar.
expression2
Is an expression, usually a column searched for the specified sequence. expression2 is an expression of the ntext type or a data type that can
be implicitly converted to nvarchar.
start_location
Is the character position to start searching for expression1 in expression2. If start_location is not given, is a negative number, or is 0, the
search starts at the beginning of expression2. start_location can be tinyint, smallint, int, or bigint.

Return Types

int

Examples

The following example searches for the expression 'an' from the last names of the employees in the Northwind database.

SELECT LastName, CHARINDEX('an', LastName) AS Position


FROM Employees

This is the result set:

LastName..............Position
------------------------------
Fuller................0
Peacock...............0
Callahan..............7
Davolio...............0
Leverling.............0
Buchanan..............5
Suyama................0
King..................0
Dodsworth.............0

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_charindex.asp?frame=true [23/07/2004 12:46:45 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


CHARINDEX

Returns the starting position of the specified expression in a character string.

Up One Level Syntax


SQL Overview
+ (Add) CHARINDEX ( expression1 , expression2 [ , start_location ] )

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
expression1
- (Negative) Is an expression containing the sequence of characters to be found. expression1
is an expression of the ntext type or a data type that can be implicitly converted
* (Multiply) to nvarchar.
expression2
/ (Divide) Is an expression, usually a column searched for the specified sequence.
expression2 is an expression of the ntext type or a data type that can be
% (Modulo) implicitly converted to nvarchar.
start_location
& (Bitwise AND) Is the character position to start searching for expression1 in expression2. If
start_location is not given, is a negative number, or is 0, the search starts at the
| (Bitwise OR) beginning of expression2. start_location can be tinyint, smallint, int, or
bigint.
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
Return Types
= (Equals)
> (Greater Than) int
< (Less Than)
>= (Greater Than or Equal To)
Examples
<= (Less Than or Equal To)
<> (Not Equal To) The following example searches for the expression 'an' from the last names of the
!= (Not Equal To) employees in the Northwind database.

!< (Not Less Than)


!> (Not Greater Than) SELECT LastName, CHARINDEX('an', LastName) AS Position
FROM Employees
@@IDENTITY
ABS This is the result set:

ACOS
ALL LastName..............Position
------------------------------
ALTER TABLE Fuller................0
Peacock...............0
AND Callahan..............7
Davolio...............0
ASIN Leverling.............0
Buchanan..............5
Suyama................0

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_charindex.asp (1 of 3) [23/07/2004 12:46:59 p.m.]


Welcome to the MSDN Library

ATAN King..................0
Dodsworth.............0

ATN2
AVG
BETWEEN
CASE
CEILING Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
CHARINDEX
©2004 Microsoft Corporation. All rights reserved. Terms of Use |
COALESCE Trademarks |Privacy Statement
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_charindex.asp (2 of 3) [23/07/2004 12:46:59 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_charindex.asp (3 of 3) [23/07/2004 12:46:59 p.m.]


COALESCE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


COALESCE

Returns the first nonnull expression among its arguments.

Syntax

COALESCE ( expression [ ,...n ] )

Arguments

expression
Is an expression of any data type.
n
Is a placeholder indicating that multiple expressions can be specified. All expressions must be of the same type or must be implicitly
convertible to the same type.

Return Types

Returns the highest precedence type from the set of types in expression.

Examples

In this example, the wages table is shown to include three columns with information about an employee's yearly wage: hourly_wage, salary, and
commission. However, an employee receives only one type of pay. To determine the total amount paid to all employees, use the COALESCE function to
receive only the nonnull value found in hourly_wage, salary, and commission.

CREATE TABLE wages


(
emp_id int identity,
hourly_wage numeric NULL,
salary numeric NULL,
commission numeric NULL,
num_sales int NULL
)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(10.00, NULL, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(20.00, NULL, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(30.00, NULL, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(40.00, NULL, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, 10000.00, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, 20000.00, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, 30000.00, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, 40000.00, NULL, NULL)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, NULL, 15000, 3)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, NULL, 25000, 2)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, NULL, 20000, 6)
INSERT wages (hourly_wage, salary, commission, num_sales) VALUES(NULL, NULL, 14000, 4)
SELECT CONVERT(money, COALESCE(hourly_wage * 40 * 52,
salary,commission * num_sales)) AS "Total Salary"
FROM wages

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_coalesce.asp?frame=true [23/07/2004 12:47:47 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server >
MSDN Library Go SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for
SQL Server CE
Advanced Search

SQL Server CE Books Online


COALESCE

Returns the first nonnull expression among its arguments.

Up One Level Syntax


SQL Overview
+ (Add) COALESCE ( expression [ ,...n ] )

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
expression
- (Negative) Is an expression of any data type.
n
* (Multiply) Is a placeholder indicating that multiple expressions can be specified. All expressions must
be of the same type or must be implicitly convertible to the same type.
/ (Divide)
% (Modulo)
Return Types
& (Bitwise AND)
| (Bitwise OR) Returns the highest precedence type from the set of types in expression.
^ (Bitwise Exclusive OR)
~ (Bitwise NOT)
Examples
= (Equals)
> (Greater Than) In this example, the wages table is shown to include three columns with information about an
< (Less Than) employee's yearly wage: hourly_wage, salary, and commission. However, an employee receives
only one type of pay. To determine the total amount paid to all employees, use the COALESCE
>= (Greater Than or Equal To) function to receive only the nonnull value found in hourly_wage, salary, and commission.

<= (Less Than or Equal To)


<> (Not Equal To) CREATE TABLE wages
(
!= (Not Equal To) emp_id
hourly_wage
int identity,
numeric NULL,
!< (Not Less Than) salary
commission
numeric
numeric
NULL,
NULL,
!> (Not Greater Than) num_sales
)
int NULL

@@IDENTITY INSERT wages (hourly_wage, salary, commission, num_sales)


INSERT wages (hourly_wage, salary, commission, num_sales)
VALUES(10.00, NULL, NULL, NULL)
VALUES(20.00, NULL, NULL, NULL)
ABS INSERT wages (hourly_wage, salary, commission, num_sales)
INSERT wages (hourly_wage, salary, commission, num_sales)
VALUES(30.00, NULL, NULL, NULL)
VALUES(40.00, NULL, NULL, NULL)
ACOS INSERT wages (hourly_wage, salary, commission, num_sales)
INSERT wages (hourly_wage, salary, commission, num_sales)
VALUES(NULL, 10000.00, NULL, NULL)
VALUES(NULL, 20000.00, NULL, NULL)
ALL INSERT wages (hourly_wage, salary, commission, num_sales)
INSERT wages (hourly_wage, salary, commission, num_sales)
VALUES(NULL, 30000.00, NULL, NULL)
VALUES(NULL, 40000.00, NULL, NULL)
ALTER TABLE INSERT wages (hourly_wage, salary, commission, num_sales)
INSERT wages (hourly_wage, salary, commission, num_sales)
VALUES(NULL, NULL, 15000, 3)
VALUES(NULL, NULL, 25000, 2)
AND INSERT wages (hourly_wage, salary, commission, num_sales)
INSERT wages (hourly_wage, salary, commission, num_sales)
VALUES(NULL, NULL, 20000, 6)
VALUES(NULL, NULL, 14000, 4)
ASIN SELECT CONVERT(money, COALESCE(hourly_wage * 40 * 52,
salary,commission * num_sales)) AS "Total Salary"
ATAN FROM wages

ATN2
AVG

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_coalesce.asp (1 of 3) [23/07/2004 12:47:55 p.m.]


Welcome to the MSDN Library

BETWEEN
CASE
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
CEILING
CHARINDEX ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |
Privacy Statement
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_coalesce.asp (2 of 3) [23/07/2004 12:47:55 p.m.]


Welcome to the MSDN Library

NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_coalesce.asp (3 of 3) [23/07/2004 12:47:55 p.m.]


COLLATE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


COLLATE

A clause that can be applied to a database definition to define the collation.

Syntax

COLLATE < collation_name >


< collation_name > :: =
< Windows_collation_name >
< Windows_collation_name >:: =
CollationDesignator_< ComparisonStyle >
< ComparisonStyle > :: =
CaseSensitivity_AccentSensitivity

Arguments

<collation_name>
Is the name of the collation to be applied to the database definition. <collation_name> can be only a specified <Windows_collation_name>.
<Windows_collation_name>
Is the collation name for Windows collation. For a list of Windows collation names supported in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE), see the Remarks section.
CollationDesignator
Specifies the base collation rules used by the Windows collation. The base collation rules cover the following:
● An alphabet or language whose sorting rules are applied when dictionary sorting is specified.
● A code page used to store non-Unicode character data.

For example, Latin1_General and French are collation designators that use code page 1252; Turkish is a collation designator that uses code page 1254.
CaseSensitivity
Specifies case-insensitive (CI). SQL Server CE supports this option only.
AccentSensitivity
Specifies accent-sensitive (AS). SQL Server CE supports this option only.

Remarks

All databases created without specifying the Windows collation name are assigned Latin1_General, the default collation. This is an example of a Windows collation
name: Latin1_General_CI_AS. This collation uses the Latin1 General dictionary sorting rules, code page 1252. It is case-insensitive and accent-sensitive.

Use the optional COLLATE clause to specify a collation different from the default. For example, to specify a Spanish collation, use a query such as:

CREATE DATABASE "SpanishDB.sdf" DATABASEPASSWORD '<MyPwd>' COLLATE Traditional_Spanish_CI_AS

The following table lists the supported Windows collation names. Ensure that the locale is supported on the device on which the database is created.

Note Some collation values might not be supported on some devices.

Cp/Collation Unique LCID Windows collation name Identical LCID group Supported Windows locales
1250 0x0000041C Albanian Albanian

1250 0x0000041a Croatian Croatian

1250 0x00000405 Czech Czech

1250 0x0000040e Hungarian Hungarian

1250 0x0001040e Hungarian_Technical

1250 0x00000415 Polish Polish

1250 0x00000418 Romanian Romanian

1250 0x0000041b Slovak Slovak

1250 0x00000424 Slovenian Slovenian

1251 0x00000419 Cyrillic_General 0x00000402, 0x00000423, 0x00000C1A, Bulgarian, Byelorussian, Russian, Serbian
0x0000081A

1251 0x00000422 Ukrainian Ukrainian

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_collate.asp?frame=true (1 of 2) [23/07/2004 01:11:58 p.m.]


COLLATE (SQL Server CE Books Online)

1251 0x0000042f FYRO Macedonian FYRO Macedonian

1252 0x00010407 German_PhoneBook PhoneBook Sort with German

1252 0x0000040f Icelandic Icelandic

1252 0x00000406 Danish_Norwegian 0x00000414, 0x00000814 Danish, Norwegian (Bokml), Norwegian (Nyorsk)

1252 0x0000040b Finnish_Swedish 0x0000041d, 0x0000081d Finnish, Swedish

1252 0x0000040c French 0x0000080c, 0x00000c0c, 0x0000140c, French (Belgium), French (Canada), French (Luxemburg), French
0x0000180c, 0x0000100c (Standard), French (Switzerland)

1252 0x00000409 Latin1_General 0x00000436, 0x0000042D, 0x00000813, Afrikaans, Basque, Catalan, Dutch (Belgium), Dutch (Standard),
0x00000C09, 0x00002809, 0x00001009, English (Australia), English (United Kingdom), English (Canada),
0x00002409, 0x00001809, 0x00002009, English (Caribbean), English (Ireland), English (Jamaican),
0x00001409, 0x00003409, 0x00001C09, English (New Zealand), English (South Africa), English (United
0x00002C09, 0x00000438, 0x00000437, States), Faeroese, German (Austria), German (Liechtenstein),
0x00000421, 0x00000416, 0x0000083e, German (Luxemburg), German (Standard), German
0x0000043e, 0x00000441, 0x00003009, (Switzerland), Indonesian, Italian, Italian (Switzerland),
0x00000809. 0x00000403, 0x00000413, Portuguese (Brazil), Portuguese (Portugal)
0x00000407, 0x00000410, 0x00000816,
0x00000C07, 0x00001407, 0x00001007,
0x00000807, 0x00000810

1252 0x00000c0a Modern_Spanish 0x00002C0A, 0x0000400A, Spanish (Argentina), Spanish (Bolivia), Spanish (Chile), Spanish
0x0000340A, 0x0000240A, 0x0000140A, (Colombia), Spanish (Costa Rica), Spanish (Dominican Republic),
0x00001C0A, 0x0000300A, Spanish (Ecuador), Spanish (Guatemala), Spanish (Modern
0x0000440A, 0x0000100A, 0x0000480A, Sort), Spanish (Panama), Spanish (Paraguay), Spanish (Peru),
0x00004C0A, 0x0000180A, Spanish (Uruguay), Spanish (Venezuela)
0x00003C0A, 0x0000280A,
0x0000500A, 0x0000380A, 0x0000200A

1252 0x0000040a Traditional_Spanish 0x0000080a

1253 0x00000408 Greek Greek

1254 0x0000041f Turkish Turkish

1255 0x0000040d Hebrew Hebrew

1256 0x00000401 Arabic 0x00001401, 0x00003C01, 0x00000C01, Arabic (Algeria), Arabic (Bahrain), Arabic (Egypt), Arabic (Iraq),
0x00000801, 0x00002C01, 0x00003401, Arabic (Jordan), Arabic (Kuwait), Arabic (Lebanon), Arabic
0x00003001, 0x00001001, 0x00001801, (Libya), Arabic (Morocco), Arabic (Oman), Arabic (Qatar), Arabic
0x00002001, 0x00004001, 0x00002801, (Saudi Arabia), Arabic (Syria), Arabic (Tunisia), Arabic (United
0x00001C01, 0x00003801, 0x00002401, Arab Emirates), Arabic (Yemen), Farsi, Urdu
0x00000429, 0x00000420

1257 0x00000425 Estonian Estonian

1257 0x00000426 Latvian Latvian

1257 0x00000427 Lithuanian Lithuanian

1258 0x0000042a Vietnamese Vietnamese

874 0x0000041e Thai Thai

932 0x00000411 Japanese Japanese

932 0x00010411 Japanese_Unicode

936 0x00000804 Chinese_PRC 0x00000c04, 0x00001404, 0x00001004 Chinese (Hong Kong S.A.R.), Chinese (China), Chinese
(Singapore)

936 0x00020804 Chinese_PRC_Stroke 0x00020c04, 0x00021404, 0x00021004 Stroke Sort with Chinese (China)

949 0x00000412 Korean_Wansung Korean

949 0x00010412 Korean_Wansung_Unicode

950 0x00030404 Chinese_Taiwan_Bopomofo Bopomofo with Chinese (Taiwan)

950 0x00000404 Chinese_Taiwan_Stroke Chinese (Taiwan)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_collate.asp?frame=true (2 of 2) [23/07/2004 01:11:58 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
COLLATE

A clause that can be applied to a database definition to define the collation.

Syntax
Up One Level
COLLATE < collation_name >
SQL Overview < collation_name > :: =
< Windows_collation_name >
+ (Add) < Windows_collation_name >:: =
CollationDesignator_< ComparisonStyle >
+ (Positive) < ComparisonStyle > :: =
CaseSensitivity_AccentSensitivity
+ (String Concatenation)
- (Subtract)
Arguments
- (Negative)
* (Multiply) <collation_name>
/ (Divide) Is the name of the collation to be applied to the database definition. <collation_name> can be only a specified <Windows_collation_name>.
<Windows_collation_name>
% (Modulo) Is the collation name for Windows collation. For a list of Windows collation names supported in Microsoft® SQL Server™ 2000 Windows® CE Edition
(SQL Server CE), see the Remarks section.
& (Bitwise AND) CollationDesignator
Specifies the base collation rules used by the Windows collation. The base collation rules cover the following:
| (Bitwise OR)
● An alphabet or language whose sorting rules are applied when dictionary sorting is specified.
● A code page used to store non-Unicode character data.

^ (Bitwise Exclusive OR)


For example, Latin1_General and French are collation designators that use code page 1252; Turkish is a collation designator that uses code page 1254.
~ (Bitwise NOT)
CaseSensitivity
= (Equals) Specifies case-insensitive (CI). SQL Server CE supports this option only.
AccentSensitivity
> (Greater Than) Specifies accent-sensitive (AS). SQL Server CE supports this option only.

< (Less Than)


>= (Greater Than or Equal To) Remarks
<= (Less Than or Equal To)
All databases created without specifying the Windows collation name are assigned Latin1_General, the default collation. This is an example of a Windows collation
<> (Not Equal To) name: Latin1_General_CI_AS. This collation uses the Latin1 General dictionary sorting rules, code page 1252. It is case-insensitive and accent-sensitive.

!= (Not Equal To)


!< (Not Less Than) Use the optional COLLATE clause to specify a collation different from the default. For example, to specify a Spanish collation, use a query such as:

!> (Not Greater Than)


@@IDENTITY CREATE DATABASE "SpanishDB.sdf" DATABASEPASSWORD '<MyPwd>' COLLATE Traditional_Spanish_CI_AS

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_collate.asp (1 of 4) [23/07/2004 01:12:07 p.m.]


Welcome to the MSDN Library
The following table lists the supported Windows collation names. Ensure that the locale is supported on the device on which the database is created.
ABS
ACOS Note Some collation values might not be supported on some devices.
ALL
ALTER TABLE
Cp/Collation Unique LCID Windows collation name Identical LCID group Supported Windows locales
AND 1250 0x0000041C Albanian Albanian

ASIN 1250 0x0000041a Croatian Croatian

ATAN 1250 0x00000405 Czech Czech

1250 0x0000040e Hungarian Hungarian


ATN2 1250 0x0001040e Hungarian_Technical

AVG 1250 0x00000415 Polish Polish

BETWEEN
1250 0x00000418 Romanian Romanian

1250 0x0000041b Slovak Slovak

CASE 1250 0x00000424 Slovenian Slovenian

CEILING 1251 0x00000419 Cyrillic_General 0x00000402, 0x00000423, 0x00000C1A,


0x0000081A
Bulgarian, Byelorussian, Russian, Serbian

CHARINDEX 1251 0x00000422 Ukrainian Ukrainian

COALESCE
1251 0x0000042f FYRO Macedonian FYRO Macedonian

1252 0x00010407 German_PhoneBook PhoneBook Sort with German

COLLATE 1252 0x0000040f Icelandic Icelandic

CONVERT 1252 0x00000406 Danish_Norwegian 0x00000414, 0x00000814 Danish, Norwegian (Bokml), Norwegian (Nyorsk)

1252 0x0000040b Finnish_Swedish 0x0000041d, 0x0000081d Finnish, Swedish


COS 1252 0x0000040c French 0x0000080c, 0x00000c0c, 0x0000140c, French (Belgium), French (Canada), French (Luxemburg), French
0x0000180c, 0x0000100c (Standard), French (Switzerland)
COT 1252 0x00000409 Latin1_General 0x00000436, 0x0000042D, 0x00000813, Afrikaans, Basque, Catalan, Dutch (Belgium), Dutch (Standard),

COUNT
0x00000C09, 0x00002809, 0x00001009, English (Australia), English (United Kingdom), English (Canada),
0x00002409, 0x00001809, 0x00002009, English (Caribbean), English (Ireland), English (Jamaican),
0x00001409, 0x00003409, 0x00001C09, English (New Zealand), English (South Africa), English (United

CREATE DATABASE
0x00002C09, 0x00000438, 0x00000437, States), Faeroese, German (Austria), German (Liechtenstein),
0x00000421, 0x00000416, 0x0000083e, German (Luxemburg), German (Standard), German
0x0000043e, 0x00000441, 0x00003009, (Switzerland), Indonesian, Italian, Italian (Switzerland),

CREATE INDEX 0x00000809. 0x00000403, 0x00000413,


0x00000407, 0x00000410, 0x00000816,
Portuguese (Brazil), Portuguese (Portugal)

0x00000C07, 0x00001407, 0x00001007,

CREATE TABLE 0x00000807, 0x00000810

1252 0x00000c0a Modern_Spanish 0x00002C0A, 0x0000400A, Spanish (Argentina), Spanish (Bolivia), Spanish (Chile), Spanish
DATALENGTH 0x0000340A, 0x0000240A, 0x0000140A,
0x00001C0A, 0x0000300A,
(Colombia), Spanish (Costa Rica), Spanish (Dominican Republic),
Spanish (Ecuador), Spanish (Guatemala), Spanish (Modern
0x0000440A, 0x0000100A, 0x0000480A, Sort), Spanish (Panama), Spanish (Paraguay), Spanish (Peru),
Data Types 0x00004C0A, 0x0000180A,
0x00003C0A, 0x0000280A,
Spanish (Uruguay), Spanish (Venezuela)

DATEADD
0x0000500A, 0x0000380A, 0x0000200A

1252 0x0000040a Traditional_Spanish 0x0000080a

DATEDIFF 1253 0x00000408 Greek Greek

DATENAME 1254 0x0000041f Turkish Turkish

1255 0x0000040d Hebrew Hebrew


DATEPART 1256 0x00000401 Arabic 0x00001401, 0x00003C01, 0x00000C01, Arabic (Algeria), Arabic (Bahrain), Arabic (Egypt), Arabic (Iraq),
0x00000801, 0x00002C01, 0x00003401, Arabic (Jordan), Arabic (Kuwait), Arabic (Lebanon), Arabic
DDL Statements 0x00003001, 0x00001001, 0x00001801,
0x00002001, 0x00004001, 0x00002801,
(Libya), Arabic (Morocco), Arabic (Oman), Arabic (Qatar), Arabic
(Saudi Arabia), Arabic (Syria), Arabic (Tunisia), Arabic (United
0x00001C01, 0x00003801, 0x00002401, Arab Emirates), Arabic (Yemen), Farsi, Urdu
DEGREES 0x00000429, 0x00000420

DELETE
1257 0x00000425 Estonian Estonian

1257 0x00000426 Latvian Latvian

DML Statements 1257 0x00000427 Lithuanian Lithuanian

DROP INDEX 1258 0x0000042a Vietnamese Vietnamese

874 0x0000041e Thai Thai


DROP TABLE 932 0x00000411 Japanese Japanese

EXISTS 932 0x00010411 Japanese_Unicode

EXP 936 0x00000804 Chinese_PRC 0x00000c04, 0x00001404, 0x00001004 Chinese (Hong Kong S.A.R.), Chinese (China), Chinese
(Singapore)

Expressions 936 0x00020804 Chinese_PRC_Stroke 0x00020c04, 0x00021404, 0x00021004 Stroke Sort with Chinese (China)

949 0x00000412 Korean_Wansung Korean


FLOOR 949 0x00010412 Korean_Wansung_Unicode

FROM Clause 950 0x00030404 Chinese_Taiwan_Bopomofo Bopomofo with Chinese (Taiwan)

950 0x00000404 Chinese_Taiwan_Stroke Chinese (Taiwan)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_collate.asp (2 of 4) [23/07/2004 01:12:07 p.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

HAVING Clause ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_collate.asp (3 of 4) [23/07/2004 01:12:07 p.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_collate.asp (4 of 4) [23/07/2004 01:12:07 p.m.]


CONVERT (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CONVERT

Explicitly converts an expression of one data type to another.

Syntax

CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

Arguments

data_type
Is the target system-supplied data type, including bigint.
length
Is an optional parameter of nchar, nvarchar, binary, or varbinary data types.
expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
style
Is the style of date format used to convert datetime data to character data (nchar, nvarchar, nchar, or nvarchar data types), or the string format when
converting float, real, or money data to character data (nchar, nvarchar, nchar, or nvarchar data types).

SQL Server CE supports the date format in Arabic style, using the Kuwaiti algorithm.

In the table, the two columns on the left represent the style values for datetime conversion to character data. Add 100 to a style value to get a four-place
year that includes the century (yyyy).

Without century (yy) With century (yyyy) Standard Input/Output2


- 0 or 100 1 Default mon dd yyyy hh:miAM (or PM)

1 101 USA mm/dd/yy

2 102 ANSI yy.mm.dd

3 103 British/French dd/mm/yy

4 104 German dd.mm.yy

5 105 Italian dd-mm-yy

6 106 - dd mon yy

7 107 - Mon dd, yy

8 108 - hh:mm:ss

- 9 or 109 1 Default + milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM)

10 110 USA mm-dd-yy

11 111 JAPAN yy/mm/dd

12 112 ISO yymmdd

- 13 or 113 1 Europe default + milliseconds dd mon yyyy hh:mm:ss:mmm(24h)

14 114 - hh:mi:ss:mmm(24h)

- 20 or 120 1 ODBC canonical yyyy-mm-dd hh:mi:ss(24h)

- 21 or 121 1 ODBC canonical (with milliseconds) yyyy-mm-dd hh:mi:ss.mmm(24h)

- 1263 ISO8601 yyyy-mm-dd Thh:mm:ss.mmm(no spaces)

- 1301 Hijri4 dd mon yyyy hh:mi:ss:mmmAM

- 1311 Hijri4 dd/mm/yy hh:mi:ss:mmmAM

1 The default values (style 0 or 100, 9 or 109, 13 or 113, 20 or 120, and 21 or 121) always return the century (yyyy).
2 Input when converting to datetime; output when converting to character data.
3 Designed for XML use. For conversion from datetime or smalldatetime to character data, the output format is as described in the table. For conversion
from float, money, or smallmoney to character data, the output is equivalent to style 2. For conversion from real to character data, the output is
equivalent to style 1.
4 Hijri is a calendar system with several variations, of which Microsoft SQL Server 2000 uses the Kuwaiti algorithm.

The following table shows the style values for float or real conversion to character data.

Value Output
0 (default) Maximum of 6 digits. Use in scientific notation, when appropriate.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_convert.asp?frame=true (1 of 3) [23/07/2004 01:50:58 p.m.]


CONVERT (SQL Server CE Books Online)

1 Always 8 digits. Always use in scientific notation.

2 Always 16 digits. Always use in scientific notation.

In the following table, the column on the left represents the style value for money conversion to character data.

Value Output
0 (default) No commas every 3 digits to the left of the decimal point, and 2 digits to the right of the decimal point (for example, 4235.98).

1 Commas every 3 digits to the left of the decimal point, and 2 digits to the right of the decimal point (for example, 3,510.92).

2 No commas every 3 digits to the left of the decimal point, and 4 digits to the right of the decimal point (for example, 4235.9819).

Return Types

Returns the same value as the data_type argument.

Remarks

Examples

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_convert.asp?frame=true (2 of 3) [23/07/2004 01:50:58 p.m.]


CONVERT (SQL Server CE Books Online)

The following example converts a datetime value in the Northwind database to an nvarchar value.

SELECT OrderDate, CONVERT(nvarchar(10), OrderDate, 101)


FROM Orders

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_convert.asp?frame=true (3 of 3) [23/07/2004 01:50:58 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server
2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
CONVERT

Explicitly converts an expression of one data type to another.

Syntax
Up One Level
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
SQL Overview
+ (Add)
Arguments
+ (Positive)
+ (String Concatenation) data_type
- (Subtract) length
Is the target system-supplied data type, including bigint.

- (Negative) expression
Is an optional parameter of nchar, nvarchar, binary, or varbinary data types.

* (Multiply) style
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).

/ (Divide) Is the style of date format used to convert datetime data to character data (nchar, nvarchar, nchar, or nvarchar data types), or the string format when
converting float, real, or money data to character data (nchar, nvarchar, nchar, or nvarchar data types).
% (Modulo)
& (Bitwise AND) SQL Server CE supports the date format in Arabic style, using the Kuwaiti algorithm.

| (Bitwise OR)
^ (Bitwise Exclusive OR) In the table, the two columns on the left represent the style values for datetime conversion to character data. Add 100 to a style value to get a four-place
year that includes the century (yyyy).
~ (Bitwise NOT)
= (Equals)
> (Greater Than) Without century (yy) With century (yyyy) Standard Input/Output2

< (Less Than) - 0 or 100 1 Default mon dd yyyy hh:miAM (or PM)

1 101 USA mm/dd/yy


>= (Greater Than or Equal To) 2 102 ANSI yy.mm.dd

<= (Less Than or Equal To) 3 103 British/French dd/mm/yy

<> (Not Equal To) 4 104 German dd.mm.yy

5 105 Italian dd-mm-yy

!= (Not Equal To) 6 106 - dd mon yy

!< (Not Less Than) 7 107 - Mon dd, yy

8 108 - hh:mm:ss
!> (Not Greater Than) - 9 or 109 1 Default + milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM)

@@IDENTITY 10 110 USA mm-dd-yy

11 111 JAPAN yy/mm/dd

12 112 ISO yymmdd

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_convert.asp (1 of 4) [23/07/2004 01:51:04 p.m.]


Welcome to the MSDN Library
- 13 or 113 1 Europe default + milliseconds dd mon yyyy hh:mm:ss:mmm(24h)

ABS 14 114 - hh:mi:ss:mmm(24h)

ACOS - 20 or 120 1 ODBC canonical yyyy-mm-dd hh:mi:ss(24h)

- 21 or 121 1 ODBC canonical (with milliseconds) yyyy-mm-dd hh:mi:ss.mmm(24h)

ALL - 1263 ISO8601 yyyy-mm-dd Thh:mm:ss.mmm(no spaces)

ALTER TABLE - 1301 Hijri4 dd mon yyyy hh:mi:ss:mmmAM

- 1311 Hijri4 dd/mm/yy hh:mi:ss:mmmAM


AND
ASIN
1 The default values (style 0 or 100, 9 or 109, 13 or 113, 20 or 120, and 21 or 121) always return the century (yyyy).
ATAN 2 Input when converting to datetime; output when converting to character data.
3 Designed for XML use. For conversion from datetime or smalldatetime to character data, the output format is as described in the table. For conversion
ATN2 from float, money, or smallmoney to character data, the output is equivalent to style 2. For conversion from real to character data, the output is
equivalent to style 1.
AVG 4 Hijri is a calendar system with several variations, of which Microsoft SQL Server 2000 uses the Kuwaiti algorithm.

BETWEEN
CASE The following table shows the style values for float or real conversion to character data.

CEILING
CHARINDEX Value Output
COALESCE 0 (default) Maximum of 6 digits. Use in scientific notation, when appropriate.

COLLATE 1 Always 8 digits. Always use in scientific notation.

2 Always 16 digits. Always use in scientific notation.

CONVERT
COS In the following table, the column on the left represents the style value for money conversion to character data.
COT
COUNT
Value Output
CREATE DATABASE 0 (default) No commas every 3 digits to the left of the decimal point, and 2 digits to the right of the decimal point (for example, 4235.98).

CREATE INDEX 1 Commas every 3 digits to the left of the decimal point, and 2 digits to the right of the decimal point (for example, 3,510.92).

CREATE TABLE 2 No commas every 3 digits to the left of the decimal point, and 4 digits to the right of the decimal point (for example, 4235.9819).

DATALENGTH
Data Types Return Types
DATEADD
DATEDIFF Returns the same value as the data_type argument.

DATENAME
DATEPART Remarks
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_convert.asp (2 of 4) [23/07/2004 01:51:04 p.m.]


Welcome to the MSDN Library

GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM Examples
SELECT Statement
SIGN The following example converts a datetime value in the Northwind database to an nvarchar value.

SIN
SOME | ANY SELECT OrderDate, CONVERT(nvarchar(10), OrderDate, 101)
FROM Orders
SPACE
SQRT
STR
STUFF

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_convert.asp (3 of 4) [23/07/2004 01:51:04 p.m.]


Welcome to the MSDN Library

SUBSTRING
SUM Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

TAN ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_convert.asp (4 of 4) [23/07/2004 01:51:04 p.m.]


COUNT (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


COUNT

Returns the number of items in a group.

Syntax

COUNT ( { [ ALL ] expression | * } )

Arguments

ALL
Applies the aggregate function to all values. ALL is the default.
expression
Is an expression of any type except uniqueidentifier, image, or ntext. Aggregate functions and subqueries are not permitted.
*
Specifies that all rows should be counted to return the total number of rows in a table. COUNT(*) takes no parameters. COUNT(*) does not
require an expression parameter because, by definition, it does not use information about any particular column. COUNT(*) returns the
number of rows in a specified table without eliminating duplicates. It counts each row separately, including rows that contain null values.

Return Types

int

Examples

The following example counts the discontinued items in the Products table in the Northwind database.

SELECT COUNT(ProductID) AS "Total Discontinued" FROM Products WHERE Discontinued = 1

This is the result set:

Total Discontinued
--------------------
8

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_count.asp?frame=true [23/07/2004 04:28:23 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


COUNT

Returns the number of items in a group.

Up One Level Syntax


SQL Overview
+ (Add) COUNT ( { [ ALL ] expression | * } )

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
ALL
- (Negative) Applies the aggregate function to all values. ALL is the default.
expression
* (Multiply) Is an expression of any type except uniqueidentifier, image, or ntext.
Aggregate functions and subqueries are not permitted.
/ (Divide) *
Specifies that all rows should be counted to return the total number of rows in a
% (Modulo) table. COUNT(*) takes no parameters. COUNT(*) does not require an expression
parameter because, by definition, it does not use information about any
& (Bitwise AND) particular column. COUNT(*) returns the number of rows in a specified table
without eliminating duplicates. It counts each row separately, including rows that
| (Bitwise OR) contain null values.

^ (Bitwise Exclusive OR)


~ (Bitwise NOT) Return Types
= (Equals)
> (Greater Than) int

< (Less Than)


>= (Greater Than or Equal To) Examples
<= (Less Than or Equal To)
<> (Not Equal To) The following example counts the discontinued items in the Products table in the
Northwind database.
!= (Not Equal To)
!< (Not Less Than) SELECT COUNT(ProductID) AS "Total Discontinued" FROM Products WHERE Discontinued = 1
!> (Not Greater Than)
@@IDENTITY This is the result set:

ABS
ACOS Total Discontinued
--------------------
ALL 8

ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_count.asp (1 of 3) [23/07/2004 04:28:26 p.m.]


Welcome to the MSDN Library

ATAN
ATN2
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
AVG
BETWEEN ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
Trademarks |Privacy Statement
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_count.asp (2 of 3) [23/07/2004 04:28:26 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_count.asp (3 of 3) [23/07/2004 04:28:26 p.m.]


CREATE DATABASE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CREATE DATABASE

Creates a new database and the file used to store the database.

Note To execute the CREATE DATABASE statement, you must be connected to a database. For information about connecting to a
database, see Using SQL Server CE Query Analyzer.

Syntax

CREATE DATABASE database_name


[DATABASEPASSWORD 'database_password'
[ENCRYPTION {ON|OFF}]
]
[COLLATE collation_name comparison_style]
database password ::= identifier

Arguments

database_name
Is the name of the new database. database_name is a file name and is restricted by the naming and size limitations of the operating system.
Any valid character that can be used in a file name can be used for the database name. If a path name is not specified, the database is created
in the current directory. The file extension for a database name in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) is
.sdf.
'database_password'
Is the name of the password that allows for the database to be opened. SQL Server CE returns an error if a user connects to a password-
protected database without a password. database_password must be enclosed in single quotation marks.

If the optional ENCRYPTION ON keyword is passed, the database is encrypted with 128-bit encryption.
collation_name
Specifies the default collation for the database. collation_name can only be a Windows collation. If collation_name is not specified, the
database is assigned the default collation of the device. For a list of collation names, see COLLATE.
comparison_style
Specifies the comparison style of characters. SQL Server CE supports only CI_AS (case insensitive and accent sensitive).

collation_name and comparison_style must not be enclosed in single or double quotation marks.

Examples

A. Creating a password-protected database

The following example creates a database with a password.

CREATE DATABASE "\test1.SDF" DATABASEPASSWORD '<tst1_pwd>'

When a user tries to connect to a password-protected database without supplying the correct password, SQL Server CE returns this error:

Error: 0x80040e4d DB_SEC_E_AUTH_FAILED


Minor Error: (25028)
Description: Authentication failed.
Interface defining error: IID_IDBInitialize
Param. 0:0
Param. 1:0
Param. 2:0
Param. 3:
Param. 4:
Param. 5:

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_database.asp?frame=true (1 of 2) [23/07/2004 04:29:14 p.m.]


CREATE DATABASE (SQL Server CE Books Online)

For information about errors, see SQL Server CE Errors.

B. Creating a database with a collation specified

The following example specifies a specific collation for the database being created.

CREATE DATABASE "SpanishDB.sdf" DATABASEPASSWORD '<MyPwd>' COLLATE Traditional_Spanish_CI_AS

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_database.asp?frame=true (2 of 2) [23/07/2004 04:29:14 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server >
MSDN Library Go SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for
SQL Server CE
Advanced Search

SQL Server CE Books Online


CREATE DATABASE

Creates a new database and the file used to store the database.

Note To execute the CREATE DATABASE statement, you must be connected


Up One Level to a database. For information about connecting to a database, see Using SQL

SQL Overview Server CE Query Analyzer.

+ (Add)
+ (Positive) Syntax
+ (String Concatenation)
- (Subtract) CREATE DATABASE database_name
[DATABASEPASSWORD 'database_password'
- (Negative) [ENCRYPTION {ON|OFF}]
]
* (Multiply) [COLLATE collation_name comparison_style]
database password ::= identifier
/ (Divide)
% (Modulo)
Arguments
& (Bitwise AND)
| (Bitwise OR) database_name
Is the name of the new database. database_name is a file name and is restricted by the
^ (Bitwise Exclusive OR) naming and size limitations of the operating system. Any valid character that can be used
in a file name can be used for the database name. If a path name is not specified, the
~ (Bitwise NOT) database is created in the current directory. The file extension for a database name in
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) is .sdf.
= (Equals) 'database_password'
> (Greater Than) Is the name of the password that allows for the database to be opened. SQL Server CE
returns an error if a user connects to a password-protected database without a password.
< (Less Than) database_password must be enclosed in single quotation marks.

>= (Greater Than or Equal To) If the optional ENCRYPTION ON keyword is passed, the database is encrypted with 128-bit
<= (Less Than or Equal To) encryption.
collation_name
<> (Not Equal To) Specifies the default collation for the database. collation_name can only be a Windows
collation. If collation_name is not specified, the database is assigned the default collation
!= (Not Equal To) of the device. For a list of collation names, see COLLATE.
!< (Not Less Than) comparison_style
Specifies the comparison style of characters. SQL Server CE supports only CI_AS (case
!> (Not Greater Than) insensitive and accent sensitive).

@@IDENTITY
collation_name and comparison_style must not be enclosed in single or double quotation
ABS marks.

ACOS
ALL Examples
ALTER TABLE
AND A. Creating a password-protected database
ASIN
ATAN The following example creates a database with a password.

ATN2
AVG CREATE DATABASE "\test1.SDF" DATABASEPASSWORD '<tst1_pwd>'

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_database.asp (1 of 3) [23/07/2004 04:29:18 p.m.]


Welcome to the MSDN Library

BETWEEN When a user tries to connect to a password-protected database without supplying the correct
password, SQL Server CE returns this error:
CASE
CEILING
CHARINDEX
Error: 0x80040e4d DB_SEC_E_AUTH_FAILED
Minor Error: (25028)

COALESCE
Description: Authentication failed.
Interface defining error: IID_IDBInitialize

COLLATE
Param. 0:0
Param. 1:0

CONVERT
Param. 2:0
Param. 3:

COS
Param. 4:
Param. 5:

COT
COUNT For information about errors, see SQL Server CE Errors.

CREATE DATABASE
CREATE INDEX B. Creating a database with a collation specified
CREATE TABLE
DATALENGTH The following example specifies a specific collation for the database being created.

Data Types
DATEADD CREATE DATABASE "SpanishDB.sdf" DATABASEPASSWORD '<MyPwd>' COLLATE Traditional_Spanish_CI_AS

DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

DELETE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |

DML Statements Privacy Statement

DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_database.asp (2 of 3) [23/07/2004 04:29:18 p.m.]


Welcome to the MSDN Library

NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_database.asp (3 of 3) [23/07/2004 04:29:18 p.m.]


CREATE INDEX (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CREATE INDEX

Creates an index on a given table.

Syntax

CREATE [ UNIQUE ] INDEX index_name


ON table ( column [ ASC | DESC ] [ ,...n ] )

Arguments

UNIQUE
Creates a unique index (one in which no two rows are permitted to have the same index value) on a table.

Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) checks for duplicate values when the index is created (if data
already exists) and checks each time data is added with an INSERT or UPDATE statement. Duplicates must be eliminated before a
unique index can be created on the column(s). If duplicate key values exist, the CREATE INDEX statement is canceled and an error
is returned. A unique index can be created only on columns that are defined as NOT NULL.

When a unique index exists, UPDATE or INSERT statements that would generate duplicate key values are rolled back, and SQL
Server CE returns an error. This is true even if the UPDATE or INSERT statement changes many rows but causes only one
duplicate.

index_name
Is the name of the index. Index names must be unique within a table but do not need to be unique within a database. Index names must
follow the rules of identifiers.
table
Is the table that contains the column or columns to be indexed.
column
Is the column or columns to which the index applies. Specify two or more column names to create a composite index on the combined values
in the specified columns. List the columns to be included in the composite index (in sort-priority order) inside the parentheses after table.

Note Columns consisting of the ntext or image data types cannot be specified as columns for an index.

Important All columns in a UNIQUE INDEX must have NOT NULL specified.

[ASC | DESC]
Determines the sort direction for the particular index column: ASC, the default, is ascending; and DESC is descending.
n
Is a placeholder indicating that multiple columns can be specified for any particular index. The maximum number of columns that can
participate in an index is 10.

Examples

The following example creates a unique index on the MyCustomers table.

CREATE TABLE MyCustomers (CustID int, CompanyName nvarchar(50))


CREATE UNIQUE INDEX idxCustId ON MyCustomers (CustId)

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_index.asp?frame=true (1 of 2) [23/07/2004 05:07:36 p.m.]


CREATE INDEX (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_index.asp?frame=true (2 of 2) [23/07/2004 05:07:36 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


CREATE INDEX

Creates an index on a given table.

Up One Level Syntax


SQL Overview
+ (Add) CREATE [ UNIQUE ] INDEX index_name
ON table ( column [ ASC | DESC ] [ ,...n ] )
+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
- (Negative) UNIQUE
Creates a unique index (one in which no two rows are permitted to have the
* (Multiply) same index value) on a table.

/ (Divide)
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
% (Modulo) CE) checks for duplicate values when the index is created (if data
already exists) and checks each time data is added with an INSERT
& (Bitwise AND) or UPDATE statement. Duplicates must be eliminated before a unique
index can be created on the column(s). If duplicate key values exist,
| (Bitwise OR) the CREATE INDEX statement is canceled and an error is returned. A
unique index can be created only on columns that are defined as
^ (Bitwise Exclusive OR) NOT NULL.

~ (Bitwise NOT)
= (Equals) When a unique index exists, UPDATE or INSERT statements that
would generate duplicate key values are rolled back, and SQL Server
> (Greater Than) CE returns an error. This is true even if the UPDATE or INSERT
statement changes many rows but causes only one duplicate.
< (Less Than)
>= (Greater Than or Equal To) index_name
Is the name of the index. Index names must be unique within a table but do not
<= (Less Than or Equal To) need to be unique within a database. Index names must follow the rules of
identifiers.
<> (Not Equal To) table
Is the table that contains the column or columns to be indexed.
!= (Not Equal To) column
Is the column or columns to which the index applies. Specify two or more
!< (Not Less Than) column names to create a composite index on the combined values in the
specified columns. List the columns to be included in the composite index (in
!> (Not Greater Than) sort-priority order) inside the parentheses after table.

@@IDENTITY
Note Columns consisting of the ntext or image data types cannot
ABS be specified as columns for an index.

ACOS
ALL Important All columns in a UNIQUE INDEX must have NOT NULL
specified.
ALTER TABLE
AND
[ASC | DESC]
ASIN Determines the sort direction for the particular index column: ASC, the default,
is ascending; and DESC is descending.
n

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_index.asp (1 of 3) [23/07/2004 05:07:40 p.m.]


Welcome to the MSDN Library

ATAN Is a placeholder indicating that multiple columns can be specified for any
particular index. The maximum number of columns that can participate in an
ATN2 index is 10.

AVG
BETWEEN Examples
CASE
The following example creates a unique index on the MyCustomers table.
CEILING
CHARINDEX
CREATE TABLE MyCustomers (CustID int, CompanyName nvarchar(50))
COALESCE CREATE UNIQUE INDEX idxCustId ON MyCustomers (CustId)

COLLATE
CONVERT
COS
COT
COUNT Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

CREATE DATABASE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |
CREATE INDEX Trademarks |Privacy Statement

CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_index.asp (2 of 3) [23/07/2004 05:07:40 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_index.asp (3 of 3) [23/07/2004 05:07:40 p.m.]


CREATE TABLE (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


CREATE TABLE

Creates a new table.

Syntax

CREATE TABLE table_name


( { < column_definition > | < table_constraint > } [ ,...n ]
)
< column_definition > ::=
{ column_name data_type }
[ { DEFAULT constant_expression
| [ IDENTITY [ ( seed , increment ) ]
]
} ]
[ ROWGUIDCOL ]
[ < column_constraint > [ ...n ] ]
< column_constraint > ::=
[ CONSTRAINT constraint_name ]
{ [ NULL | NOT NULL ]
| [ PRIMARY KEY | UNIQUE ]
| REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
}
< table_constraint > ::=
[ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
{ ( column [ ,...n ] ) }
]
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table ( ref_column [ ,...n ] )
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
}

Arguments

table_name
Is the name of the new table. Table names must conform to the rules for identifiers. table_name must be unique within the database.
table_name can contain a maximum of 128 characters.
column_name
Is the name of a column in the table. Column names must conform to the rules for identifiers and must be unique in the table.
data_type
Specifies the column data type. For information about data types, see Data Types.
DEFAULT
Specifies the value provided for the column when a value is not explicitly supplied during an insert action. DEFAULT definitions can be applied
to any column, except those defined by the IDENTITY property. DEFAULT definitions are removed when the table is dropped. A constant value,
such as a character string, or a date function can be used as a default.
IDENTITY
Indicates that the new column is an identity column. When a new row is added to the table, Microsoft® SQL Server™ 2000 Windows® CE
Edition (SQL Server CE) provides a unique, incremental value for the column. Identity columns are commonly used in conjunction with
PRIMARY KEY constraints to serve as the unique row identifier for the table. The IDENTITY property can be assigned only to int columns. Only
one identity column can be created per table. Bound defaults and DEFAULT constraints cannot be used with an identity column. You must
specify both the seed and increment or neither. If neither is specified, the default is (1,1).
seed
Is the value used for the first row that is loaded into the table.
increment
Is the incremental value added to the identity value of the previous row that is loaded.
ROWGUIDCOL
Indicates that the new column is a row global unique identifier column. Only one uniqueidentifier column per table can be designated as the
ROWGUIDCOL column. The ROWGUIDCOL property can be assigned only to a uniqueidentifier column.

ROWGUIDCOL automatically generates values for new rows inserted into the table.
CONSTRAINT
Is an optional keyword indicating the beginning of a PRIMARY KEY, UNIQUE, or FOREIGN KEY constraint definition. Constraints are special
properties that enforce data integrity and create special types of indexes for the table and its columns.
constraint_name
Is the name of a constraint. constraint_name is optional and must be unique within a database. If constraint_name is not specified, SQL Server
CE generates a constraint name.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_table.asp?frame=true (1 of 3) [23/07/2004 06:07:56 p.m.]


CREATE TABLE (SQL Server CE Books Online)

NULL | NOT NULL


Are keywords that specify whether null values are allowed in the column. NULL is not strictly a constraint but can be specified in the same
manner as NOT NULL.
PRIMARY KEY
Is a constraint that enforces entity integrity for a given column or columns using a unique index. Only one PRIMARY KEY constraint can be
created per table.
UNIQUE
Is a constraint that provides entity integrity for a given column or columns using a unique index. Columns in a UNIQUE constraint must also be
NOT NULL. A table can have multiple UNIQUE constraints.

Note SQL Server CE can use indexes to enforce PRIMARY KEY and UNIQUE constraints. You should not rely on this behavior nor
try to manipulate any indexes that are created as part of a constraint.

FOREIGN KEY...REFERENCES
Is a constraint that provides referential integrity for the data in the column. FOREIGN KEY constraints require that each value in the column
exists in the specified column in the referenced table.
ref_table
Is the name of the table referenced by the FOREIGN KEY constraint.
( ref_column [ ,...n ] )
Is a column, or list of columns, from the table referenced by the FOREIGN KEY constraint.
ON DELETE {CASCADE | NO ACTION}
Specifies what action takes place to a row in the table that is created when that row has a referential relationship and the referenced row is
deleted from the parent table. The default is NO ACTION.

If CASCADE is specified, a row is deleted from the referencing table when the corresponding referenced row is deleted from the
parent table. If NO ACTION is specified, SQL Server CE raises an error and the delete action on the referenced row in the parent
table is rolled back.

For example, in the Northwind database, the Orders table has a referential relationship with the Customers table: the
Orders.CustomerID foreign key references the Customers.CustomerID primary key.

If a DELETE statement is executed on a row in the Customers table and an ON DELETE CASCADE action is specified for
Orders.CustomerID, SQL Server CE checks for one or more dependent rows in the Orders table. If any exists, the dependent
rows in the Orders table are deleted, as well as the row referenced in the Customers table.

Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls back the delete action on the row in the Customers
table when there is at least one row in the Orders table that references it.

ON UPDATE {CASCADE | NO ACTION}


Specifies what action takes place to a row in the table that is created when that row has a referential relationship and the referenced row is
updated in the parent table. The default is NO ACTION.

If CASCADE is specified, the row is updated in the referencing table when the corresponding referenced row is updated in the
parent table. If NO ACTION is specified, SQL Server CE raises an error and the update action on the referenced row in the parent
table is rolled back.

For example, in the Northwind database, the Orders table has a referential relationship with the Customers table: the
Orders.CustomerID foreign key references the Customers.CustomerID primary key.

If an UPDATE statement is executed on a row in the Customers table and an ON UPDATE CASCADE action is specified for
Orders.CustomerID, SQL Server CE checks for one or more dependent rows in the Orders table. If any exists, the dependent
rows in the Orders table are updated, as well as the row referenced in the Customers table.

Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls back the update action on the referenced row in the
Customers table when there is at least one row in the Orders table that references it.

column
Is a column or list of columns, in parentheses, used in table constraints to indicate the columns used in the constraint definition.

Remarks

Constraints

● PRIMARY KEY Constraints


● A table can contain only one PRIMARY KEY constraint.
● Each PRIMARY KEY generates an index.
● All columns defined within a PRIMARY KEY constraint must be defined as NOT NULL. If nullability is not specified, all columns participating in a PRIMARY KEY constraint have their nullability set to NOT NULL.
● UNIQUE Constraints
● Each UNIQUE constraint generates an index.
● All columns defined as a UNIQUE constraint must be defined as NOT NULL. If nullability is not specified, all columns defined as UNIQUE constraints have their nullability set to NOT NULL.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_table.asp?frame=true (2 of 3) [23/07/2004 06:07:56 p.m.]


CREATE TABLE (SQL Server CE Books Online)

● FOREIGN KEY Constraints


● When a value other than NULL is entered into the column of a FOREIGN KEY constraint, the value must exist in the referenced column; otherwise, a foreign key violation error message is returned.
● FOREIGN KEY constraints can reference another column in the same table (a self-reference). However, FOREIGN KEY constraints cannot be used to create a self-referencing or circular FOREIGN KEY constraint.
● The REFERENCES clause of a column-level FOREIGN KEY constraint can list only one reference column, which must have the same data type as the column on which the constraint is defined.
● The REFERENCES clause of a table-level FOREIGN KEY constraint must have the same number of reference columns as the number of columns in the constraint column list. The data type of each reference column also must be the same as the corresponding column in
the column list.
● FOREIGN KEY constraints can reference only columns in PRIMARY KEY or UNIQUE constraints in the referenced table. FOREIGN KEY constraints cannot reference unique indexes.
● Additional Constraint Information
● An index created for a constraint cannot be dropped with the DROP INDEX statement; the constraint must be dropped with the ALTER TABLE DROP CONSTRAINT statement.
● Constraint names must follow the rules for identifiers, except that the name cannot begin with a number sign (#). If the CONSTRAINT keyword and constraint_name is not supplied, a system-generated name is assigned to the constraint.
● When a constraint is violated in an INSERT, UPDATE, or DELETE statement, the statement is terminated.

DEFAULT Definitions

A column can have only one DEFAULT definition, which can contain constant values or constant functions.

Nullability Rules Within a Table Definition

The nullability of a column determines whether or not that column can allow a null value (NULL) as the data in that column. NULL is not zero or blank: it
means no entry was made or an explicit NULL was supplied, and it usually implies that the value is either unknown or not applicable.

Examples

The following example creates a two-column table with an identity column as the PRIMARY KEY.

CREATE TABLE MyCustomers (CustID int IDENTITY (100,1) PRIMARY KEY, CompanyName nvarchar (50))

The following example creates a one-column table with a PRIMARY KEY constraint.

CREATE TABLE MyCustomers2 (CustID int CONSTRAINT pkCustId PRIMARY KEY)

The following example creates a table with one of its columns referencing a column in another table.

CREATE TABLE MyOrders (OrderID int, CustID int REFERENCES MyCustomers(CustID))

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_create_table.asp?frame=true (3 of 3) [23/07/2004 06:07:56 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server >
MSDN Library Go SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for
SQL Server CE
Advanced Search

SQL Server CE Books Online


CREATE TABLE

Creates a new table.

Up One Level Syntax


SQL Overview
+ (Add) CREATE TABLE table_name
( { < column_definition > | < table_constraint > } [ ,...n ]
+ (Positive) )
< column_definition > ::=
+ (String Concatenation) { column_name data_type }
[ { DEFAULT constant_expression
- (Subtract) | [ IDENTITY [ ( seed , increment ) ]
]
- (Negative) } ]
[ ROWGUIDCOL ]
* (Multiply) [ < column_constraint > [ ...n ] ]
< column_constraint > ::=
/ (Divide) [ CONSTRAINT constraint_name ]
{ [ NULL | NOT NULL ]
% (Modulo) | [ PRIMARY KEY | UNIQUE ]
| REFERENCES ref_table [ ( ref_column ) ]
& (Bitwise AND) [ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
| (Bitwise OR) }
< table_constraint > ::=
^ (Bitwise Exclusive OR) [ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
~ (Bitwise NOT) { ( column [ ,...n ] ) }
]
= (Equals) | FOREIGN KEY
[ ( column [ ,...n ] ) ]
> (Greater Than) REFERENCES ref_table ( ref_column [ ,...n ] )
[ ON DELETE { CASCADE | NO ACTION } ]
< (Less Than) }
[ ON UPDATE { CASCADE | NO ACTION } ]

>= (Greater Than or Equal To)


<= (Less Than or Equal To) Arguments
<> (Not Equal To)
!= (Not Equal To) table_name
Is the name of the new table. Table names must conform to the rules for identifiers.
!< (Not Less Than) table_name must be unique within the database. table_name can contain a maximum of
128 characters.
!> (Not Greater Than) column_name
Is the name of a column in the table. Column names must conform to the rules for
@@IDENTITY identifiers and must be unique in the table.
data_type
ABS Specifies the column data type. For information about data types, see Data Types.
DEFAULT
ACOS Specifies the value provided for the column when a value is not explicitly supplied during
an insert action. DEFAULT definitions can be applied to any column, except those defined
ALL by the IDENTITY property. DEFAULT definitions are removed when the table is dropped. A
constant value, such as a character string, or a date function can be used as a default.
ALTER TABLE IDENTITY
Indicates that the new column is an identity column. When a new row is added to the table,
AND Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides a unique,
incremental value for the column. Identity columns are commonly used in conjunction with
ASIN PRIMARY KEY constraints to serve as the unique row identifier for the table. The IDENTITY
property can be assigned only to int columns. Only one identity column can be created per
ATAN table. Bound defaults and DEFAULT constraints cannot be used with an identity column.
You must specify both the seed and increment or neither. If neither is specified, the default
ATN2 is (1,1).
seed
AVG Is the value used for the first row that is loaded into the table.
increment

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_table.asp (1 of 3) [23/07/2004 06:08:00 p.m.]


Welcome to the MSDN Library

Is the incremental value added to the identity value of the previous row that is loaded.
BETWEEN ROWGUIDCOL
Indicates that the new column is a row global unique identifier column. Only one
CASE uniqueidentifier column per table can be designated as the ROWGUIDCOL column. The
ROWGUIDCOL property can be assigned only to a uniqueidentifier column.
CEILING
CHARINDEX ROWGUIDCOL automatically generates values for new rows inserted into the table.
COALESCE CONSTRAINT
Is an optional keyword indicating the beginning of a PRIMARY KEY, UNIQUE, or FOREIGN
COLLATE KEY constraint definition. Constraints are special properties that enforce data integrity and
create special types of indexes for the table and its columns.
CONVERT constraint_name
Is the name of a constraint. constraint_name is optional and must be unique within a
COS database. If constraint_name is not specified, SQL Server CE generates a constraint name.
NULL | NOT NULL
COT Are keywords that specify whether null values are allowed in the column. NULL is not
strictly a constraint but can be specified in the same manner as NOT NULL.
COUNT PRIMARY KEY
Is a constraint that enforces entity integrity for a given column or columns using a unique
CREATE DATABASE index. Only one PRIMARY KEY constraint can be created per table.
UNIQUE
CREATE INDEX Is a constraint that provides entity integrity for a given column or columns using a unique
index. Columns in a UNIQUE constraint must also be NOT NULL. A table can have multiple
CREATE TABLE UNIQUE constraints.
DATALENGTH
Data Types Note SQL Server CE can use indexes to enforce PRIMARY KEY and UNIQUE
constraints. You should not rely on this behavior nor try to manipulate any
DATEADD indexes that are created as part of a constraint.

DATEDIFF
DATENAME FOREIGN KEY...REFERENCES
Is a constraint that provides referential integrity for the data in the column. FOREIGN KEY
DATEPART constraints require that each value in the column exists in the specified column in the
referenced table.
DDL Statements ref_table
Is the name of the table referenced by the FOREIGN KEY constraint.
DEGREES ( ref_column [ ,...n ] )
Is a column, or list of columns, from the table referenced by the FOREIGN KEY constraint.
DELETE ON DELETE {CASCADE | NO ACTION}
Specifies what action takes place to a row in the table that is created when that row has a
DML Statements referential relationship and the referenced row is deleted from the parent table. The default
is NO ACTION.
DROP INDEX
DROP TABLE If CASCADE is specified, a row is deleted from the referencing table when the
corresponding referenced row is deleted from the parent table. If NO ACTION is
EXISTS specified, SQL Server CE raises an error and the delete action on the referenced
row in the parent table is rolled back.
EXP
Expressions For example, in the Northwind database, the Orders table has a referential
relationship with the Customers table: the Orders.CustomerID foreign key
FLOOR references the Customers.CustomerID primary key.

FROM Clause
Functions If a DELETE statement is executed on a row in the Customers table and an ON
DELETE CASCADE action is specified for Orders.CustomerID, SQL Server CE
GETDATE checks for one or more dependent rows in the Orders table. If any exists, the
dependent rows in the Orders table are deleted, as well as the row referenced
GROUP BY Clause in the Customers table.

HAVING Clause
Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls
IDENTITY (Property) back the delete action on the row in the Customers table when there is at least
one row in the Orders table that references it.
IN
Information Schema ON UPDATE {CASCADE | NO ACTION}
Specifies what action takes place to a row in the table that is created when that row has a
INSERT referential relationship and the referenced row is updated in the parent table. The default is
NO ACTION.
IS [NOT] NULL
LEN If CASCADE is specified, the row is updated in the referencing table when the
LIKE corresponding referenced row is updated in the parent table. If NO ACTION is
specified, SQL Server CE raises an error and the update action on the
LOG referenced row in the parent table is rolled back.

LOG10
For example, in the Northwind database, the Orders table has a referential
LOWER relationship with the Customers table: the Orders.CustomerID foreign key
references the Customers.CustomerID primary key.
LTRIM
MAX If an UPDATE statement is executed on a row in the Customers table and an
ON UPDATE CASCADE action is specified for Orders.CustomerID, SQL Server
MIN CE checks for one or more dependent rows in the Orders table. If any exists,
the dependent rows in the Orders table are updated, as well as the row
NCHAR referenced in the Customers table.

NEWID

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_table.asp (2 of 3) [23/07/2004 06:08:00 p.m.]


Welcome to the MSDN Library

Alternately, if NO ACTION is specified, SQL Server CE raises an error and rolls


NOT back the update action on the referenced row in the Customers table when
there is at least one row in the Orders table that references it.
Operators
OR column
ORDER BY Clause Is a column or list of columns, in parentheses, used in table constraints to indicate the
columns used in the constraint definition.
PATINDEX
PI Remarks
POWER
RADIANS Constraints
RAND
REPLACE ● PRIMARY KEY Constraints
● A table can contain only one PRIMARY KEY constraint.
Each PRIMARY KEY generates an index.

REPLICATE

● All columns defined within a PRIMARY KEY constraint must be defined as NOT NULL. If nullability is not specified, all columns participating in a PRIMARY KEY
constraint have their nullability set to NOT NULL.
● UNIQUE Constraints

Reserved Words
● Each UNIQUE constraint generates an index.
● All columns defined as a UNIQUE constraint must be defined as NOT NULL. If nullability is not specified, all columns defined as UNIQUE constraints have their
nullability set to NOT NULL.
● FOREIGN KEY Constraints

ROUND
● When a value other than NULL is entered into the column of a FOREIGN KEY constraint, the value must exist in the referenced column; otherwise, a foreign key
violation error message is returned.
● FOREIGN KEY constraints can reference another column in the same table (a self-reference). However, FOREIGN KEY constraints cannot be used to create a self-
referencing or circular FOREIGN KEY constraint.

RTRIM
● The REFERENCES clause of a column-level FOREIGN KEY constraint can list only one reference column, which must have the same data type as the column on
which the constraint is defined.
● The REFERENCES clause of a table-level FOREIGN KEY constraint must have the same number of reference columns as the number of columns in the constraint
column list. The data type of each reference column also must be the same as the corresponding column in the column list.

SELECT Statement
● FOREIGN KEY constraints can reference only columns in PRIMARY KEY or UNIQUE constraints in the referenced table. FOREIGN KEY constraints cannot reference
unique indexes.
● Additional Constraint Information
An index created for a constraint cannot be dropped with the DROP INDEX statement; the constraint must be dropped with the ALTER TABLE DROP CONSTRAINT

SIGN

statement.
● Constraint names must follow the rules for identifiers, except that the name cannot begin with a number sign (#). If the CONSTRAINT keyword and
constraint_name is not supplied, a system-generated name is assigned to the constraint.
When a constraint is violated in an INSERT, UPDATE, or DELETE statement, the statement is terminated.

SIN

SOME | ANY DEFAULT Definitions


SPACE
SQRT A column can have only one DEFAULT definition, which can contain constant values or constant
functions.
STR
STUFF
Nullability Rules Within a Table Definition
SUBSTRING
SUM The nullability of a column determines whether or not that column can allow a null value (NULL) as the
TAN data in that column. NULL is not zero or blank: it means no entry was made or an explicit NULL was
supplied, and it usually implies that the value is either unknown or not applicable.
UNICODE
UNION
Examples
UPDATE
UPPER The following example creates a two-column table with an identity column as the PRIMARY KEY.
WHERE Clause
CREATE TABLE MyCustomers (CustID int IDENTITY (100,1) PRIMARY KEY, CompanyName nvarchar (50))

The following example creates a one-column table with a PRIMARY KEY constraint.

CREATE TABLE MyCustomers2 (CustID int CONSTRAINT pkCustId PRIMARY KEY)

The following example creates a table with one of its columns referencing a column in another table.

CREATE TABLE MyOrders (OrderID int, CustID int REFERENCES MyCustomers(CustID))

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |


Privacy Statement

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_table.asp (3 of 3) [23/07/2004 06:08:00 p.m.]


DATALENGTH (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft
SQL Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


DATALENGTH

Returns the number of bytes used to represent any expression.

Syntax

DATALENGTH ( expression )

Arguments

expression
Is an expression of any data type.

Return Types

int

Examples

The following example returns the DATALENGTH of each company name listed in the Customers table in the Northwind database.

SELECT DATALENGTH(CompanyName), CompanyName


FROM Customers

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datalength.asp?frame=true [23/07/2004 06:41:23 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL
MSDN Library Go Server > SQL Server 2000 Windows CE Edition > Microsoft SQL Server 2000 Windows CE Edition 2.0 >
SQL Reference for SQL Server CE
Advanced Search

SQL Server CE Books Online


DATALENGTH

Returns the number of bytes used to represent any expression.

Up One Level Syntax


SQL Overview
+ (Add) DATALENGTH ( expression )

+ (Positive)
+ (String Concatenation) Arguments
- (Subtract)
expression
- (Negative) Is an expression of any data type.

* (Multiply)
/ (Divide) Return Types
% (Modulo)
& (Bitwise AND) int

| (Bitwise OR)
^ (Bitwise Exclusive OR) Examples
~ (Bitwise NOT)
= (Equals) The following example returns the DATALENGTH of each company name listed in the
Customers table in the Northwind database.
> (Greater Than)
< (Less Than) SELECT DATALENGTH(CompanyName), CompanyName
>= (Greater Than or Equal To) FROM Customers

<= (Less Than or Equal To)


<> (Not Equal To)
!= (Not Equal To)
!< (Not Less Than)
!> (Not Greater Than) Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

@@IDENTITY ©2004 Microsoft Corporation. All rights reserved. Terms of Use |

ABS Trademarks |Privacy Statement

ACOS
ALL
ALTER TABLE
AND
ASIN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datalength.asp (1 of 3) [23/07/2004 06:41:26 p.m.]


Welcome to the MSDN Library

ATAN
ATN2
AVG
BETWEEN
CASE
CEILING
CHARINDEX
COALESCE
COLLATE
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datalength.asp (2 of 3) [23/07/2004 06:41:26 p.m.]


Welcome to the MSDN Library

LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datalength.asp (3 of 3) [23/07/2004 06:41:26 p.m.]


Data Types (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


Data Types

Each column in a table in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has a data type that specifies the type of data (such as integer,
character, or money) that the column can hold.

Note There may be minor differences between Microsoft SQL Server 2000 and SQL Server CE in the way data types are promoted when the
execution of a function results in an overflow or underflow. You might have to perform explicit CAST in SQL Server 2000 to get the same
behavior in SQL Server CE.

SQL Server CE supports the following data types.

Data type Description


bigint Integer (whole number) data from -2^63 (- 9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.

integer Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

smallint Integer data from –32,768 to 32,767. Storage size is 2 bytes.

tinyint Integer data from 0 to 255. Storage size is 1 byte.

bit Integer data with either a 1 or 0 value.

numeric (p, s) Fixed-precision and scale-numeric data from -10^38 +1 through 10^38 –1. p specifies precision and can vary between 1 and 38. s specifies scale and can vary between 0
and p.

money Monetary data values from -2^63 (- 922,337,203,685,477.5808) through 2^63 - 1 (922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit.
Storage size is 8 bytes.

float Floating point number data from -1.79E + 308 through 1.79E + 308

Storage size is 8 bytes.

real Floating precision number data from -3.40E + 38 through 3.40E + 38.

datetime Date and time data from January 1, 1753, to December 31, 9999, with an accuracy of one three-hundredth second, or 3.33 milliseconds. Values are rounded to increments of
.000, .003, or .007 milliseconds.

Stored as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system's reference date. Values
for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight. Seconds
have a valid range of 0 - 59.

national character(n) Fixed-length Unicode data with a maximum length of 255 characters.
Default length = 1
Storage size, in bytes, is two times the number of characters entered.

Synonym:
nchar(n)

national character varying(n) Variable-length Unicode data with a length of 1 to 255 characters.
Default length = 1
Storage size, in bytes, is two times the number of characters entered.

Synonym:
nvarchar(n)

ntext Variable-length Unicode data with a maximum length of (2^30 - 2) / 2 (536,870,911) characters. Storage size, in bytes, is two times the number of characters entered.

binary(n) Fixed-length binary data with a maximum length of 510 bytes. Default length = 1

varbinary(n) Variable-length binary data with a maximum length of 510 bytes. Default length = 1

image Variable-length binary data with a maximum length of 2^30 – 1 (1,073,741,823) bytes.

uniqueidentifier A globally unique identifier (GUID). Storage size is 16 bytes.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_data_types.asp?frame=true (1 of 2) [23/07/2004 06:42:09 p.m.]


Data Types (SQL Server CE Books Online)

IDENTITY [(s, i)] This is a property of a data column, not a distinct data type.

Only data columns of the integer data types can be used for identity columns. A table can have only one identity column. A seed and increment can be specified and the
column cannot be updated.

s (seed) = starting value

i (increment) = increment value

ROWGUIDCOL This is a property of a data column, not a distinct data type. It is a column in a table that is defined using the uniqueidentifier data type. A table can only have one
ROWGUIDCOL column.

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_data_types.asp?frame=true (2 of 2) [23/07/2004 06:42:09 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE
MSDN Library Go
Advanced Search SQL Server CE Books Online
Data Types

Each column in a table in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has a data type that specifies the type of data (such as integer,
character, or money) that the column can hold.

Note There may be minor differences between Microsoft SQL Server 2000 and SQL Server CE in the way data types are promoted when the
execution of a function results in an overflow or underflow. You might have to perform explicit CAST in SQL Server 2000 to get the same
Up One Level behavior in SQL Server CE.

SQL Overview
+ (Add) SQL Server CE supports the following data types.

+ (Positive)
+ (String Concatenation) Data type Description

- (Subtract) bigint Integer (whole number) data from -2^63 (- 9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.

- (Negative)
integer Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

smallint Integer data from –32,768 to 32,767. Storage size is 2 bytes.

* (Multiply) tinyint Integer data from 0 to 255. Storage size is 1 byte.

/ (Divide) bit Integer data with either a 1 or 0 value.

numeric (p, s) Fixed-precision and scale-numeric data from -10^38 +1 through 10^38 –1. p specifies precision and can vary between 1 and 38. s specifies scale and can vary between 0
% (Modulo) and p.

money Monetary data values from -2^63 (- 922,337,203,685,477.5808) through 2^63 - 1 (922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit.
& (Bitwise AND) Storage size is 8 bytes.

| (Bitwise OR)
float Floating point number data from -1.79E + 308 through 1.79E + 308

^ (Bitwise Exclusive OR) Storage size is 8 bytes.

~ (Bitwise NOT)
= (Equals) real Floating precision number data from -3.40E + 38 through 3.40E + 38.

> (Greater Than) datetime Date and time data from January 1, 1753, to December 31, 9999, with an accuracy of one three-hundredth second, or 3.33 milliseconds. Values are rounded to increments of
.000, .003, or .007 milliseconds.

< (Less Than)


>= (Greater Than or Equal To) Stored as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system's reference date. Values
for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight. Seconds

<= (Less Than or Equal To)


have a valid range of 0 - 59.

<> (Not Equal To)


!= (Not Equal To) national character(n) Fixed-length Unicode data with a maximum length of 255 characters.
Default length = 1
Storage size, in bytes, is two times the number of characters entered.
!< (Not Less Than) Synonym:

!> (Not Greater Than) nchar(n)

@@IDENTITY

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_data_types.asp (1 of 4) [23/07/2004 06:42:13 p.m.]


Welcome to the MSDN Library
national character varying(n) Variable-length Unicode data with a length of 1 to 255 characters.

ABS
Default length = 1
Storage size, in bytes, is two times the number of characters entered.

ACOS Synonym:
nvarchar(n)

ALL
ALTER TABLE ntext Variable-length Unicode data with a maximum length of (2^30 - 2) / 2 (536,870,911) characters. Storage size, in bytes, is two times the number of characters entered.

AND binary(n) Fixed-length binary data with a maximum length of 510 bytes. Default length = 1

ASIN varbinary(n) Variable-length binary data with a maximum length of 510 bytes. Default length = 1

image Variable-length binary data with a maximum length of 2^30 – 1 (1,073,741,823) bytes.
ATAN uniqueidentifier A globally unique identifier (GUID). Storage size is 16 bytes.

ATN2 IDENTITY [(s, i)] This is a property of a data column, not a distinct data type.

AVG
Only data columns of the integer data types can be used for identity columns. A table can have only one identity column. A seed and increment can be specified and the

BETWEEN column cannot be updated.

CASE
s (seed) = starting value
CEILING
CHARINDEX i (increment) = increment value

COALESCE
COLLATE
ROWGUIDCOL This is a property of a data column, not a distinct data type. It is a column in a table that is defined using the uniqueidentifier data type. A table can only have one
CONVERT ROWGUIDCOL column.

COS
COT
COUNT
CREATE DATABASE Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

CREATE INDEX
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
CREATE TABLE
DATALENGTH
Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_data_types.asp (2 of 4) [23/07/2004 06:42:13 p.m.]


Welcome to the MSDN Library

Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_data_types.asp (3 of 4) [23/07/2004 06:42:13 p.m.]


Welcome to the MSDN Library

STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_data_types.asp (4 of 4) [23/07/2004 06:42:13 p.m.]


DATEADD (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


DATEADD

Returns a new datetime value based on adding an interval to the specified date.

Syntax

DATEADD ( datepart , number, date )

Arguments

datepart
Is the parameter that specifies on which part of the date to return a new value. The following table lists the dateparts and abbreviations
recognized by Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
year yy, yyyy

quarter qq, q

month mm, m

dayofyear dy, y

day dd, d

week wk, ww

hour hh

minute mi, n

second ss, s

millisecond ms

number
Is the value used to increment datepart. Is an expression of the exact numeric or approximate numeric data type categories, or types that can be
implicitly converted to float. If you specify a value that is not an integer, the fractional part of the value is discarded. For example, if you specify
day for datepart and 1.75 for number, date is incremented by 1.
date
Is an expression that returns a value that can be implicitly converted to datetime, or is a Unicode character string in a date format. For more
information about specifying dates, see datetime in Data Types.

If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted
as 1950. To avoid ambiguity, use four-digit years.

Return Types

datetime

Examples

The following example adds two months to the order date for A. Datum Corporation.

CREATE TABLE MyOrders (OrderID int IDENTITY(100, 1) PRIMARY KEY, CompanyName nvarchar(50), OrderDate datetime)
INSERT INTO MyOrders (CompanyName, OrderDate) VALUES ('A. Datum Corporation', GETDATE())
SELECT DATEADD(month, 2, OrderDate) FROM MyOrders

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_dateadd.asp?frame=true (1 of 2) [23/07/2004 07:49:29 p.m.]


DATEADD (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_dateadd.asp?frame=true (2 of 2) [23/07/2004 07:49:29 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
DATEADD

Returns a new datetime value based on adding an interval to the specified date.

Syntax
Up One Level
SQL Overview DATEADD ( datepart , number, date )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) datepart
Is the parameter that specifies on which part of the date to return a new value. The following table lists the dateparts and abbreviations
- (Negative) recognized by Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
* (Multiply)
year yy, yyyy

/ (Divide) quarter qq, q

% (Modulo) month mm, m

dayofyear dy, y
& (Bitwise AND) day dd, d

| (Bitwise OR) week wk, ww

^ (Bitwise Exclusive OR) hour hh

minute mi, n

~ (Bitwise NOT) second ss, s

= (Equals) millisecond ms

number
> (Greater Than) Is the value used to increment datepart. Is an expression of the exact numeric or approximate numeric data type categories, or types that can be
implicitly converted to float. If you specify a value that is not an integer, the fractional part of the value is discarded. For example, if you specify
< (Less Than) day for datepart and 1.75 for number, date is incremented by 1.
date
>= (Greater Than or Equal To) Is an expression that returns a value that can be implicitly converted to datetime, or is a Unicode character string in a date format. For more
information about specifying dates, see datetime in Data Types.
<= (Less Than or Equal To)
<> (Not Equal To)
If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
!= (Not Equal To) configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted
!< (Not Less Than) as 1950. To avoid ambiguity, use four-digit years.

!> (Not Greater Than)


@@IDENTITY Return Types
ABS
ACOS datetime

ALL
ALTER TABLE Examples
AND
ASIN The following example adds two months to the order date for A. Datum Corporation.

ATAN
ATN2 CREATE TABLE MyOrders (OrderID int IDENTITY(100, 1) PRIMARY KEY, CompanyName nvarchar(50), OrderDate datetime)
INSERT INTO MyOrders (CompanyName, OrderDate) VALUES ('A. Datum Corporation', GETDATE())
AVG SELECT DATEADD(month, 2, OrderDate) FROM MyOrders

BETWEEN
CASE
CEILING
CHARINDEX
COALESCE Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

COLLATE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
CONVERT
COS
COT
COUNT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
DATALENGTH

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_dateadd.asp (1 of 3) [23/07/2004 07:49:33 p.m.]


Welcome to the MSDN Library

Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_dateadd.asp (2 of 3) [23/07/2004 07:49:33 p.m.]


Welcome to the MSDN Library

UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_dateadd.asp (3 of 3) [23/07/2004 07:49:33 p.m.]


DATEDIFF (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


DATEDIFF

Returns the number of date and time boundaries crossed between two specified dates.

Syntax

DATEDIFF ( datepart , startdate , enddate )

Arguments

datepart
Is the parameter that specifies on which part of the date to calculate the difference. The following table lists dateparts and abbreviations
recognized by Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
year yy, yyyy

quarter qq, q

month mm, m

dayofyear dy, y

day dd, d

week wk, ww

hour hh

minute mi, n

second ss, s

millisecond ms

startdate
Is the beginning date for the calculation. startdate is an expression that returns a datetime value or a Unicode character string in a date format.

If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if the two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is
interpreted as 1950. To avoid ambiguity, use four-digit years.

For more information about specifying dates, see datetime in Data Types.

enddate
Is the ending date for the calculation. enddate is an expression that returns a datetime value or a Unicode character string in a date format.

Return Types

int

Examples

The following example uses the Northwind database. The example determines the number of days it took to ship the orders made by the company Vins et
alcohols Chevalier, which has a CustomerID of VINET.

SELECT OrderID, DATEDIFF (d, OrderDate, ShippedDate) AS "Shipping Time in Days" FROM Orders WHERE CustomerID = 'VINET'

This is the result set:

OrderID Shipping Time in Days


-------------------------------------
10295 8

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datediff.asp?frame=true (1 of 2) [23/07/2004 07:51:12 p.m.]


DATEDIFF (SQL Server CE Books Online)

10737 7
10274 10
10248 12
10739 5

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datediff.asp?frame=true (2 of 2) [23/07/2004 07:51:12 p.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
DATEDIFF

Returns the number of date and time boundaries crossed between two specified dates.

Syntax
Up One Level
SQL Overview DATEDIFF ( datepart , startdate , enddate )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) datepart
Is the parameter that specifies on which part of the date to calculate the difference. The following table lists dateparts and abbreviations
- (Negative) recognized by Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
* (Multiply)
year yy, yyyy

/ (Divide) quarter qq, q

% (Modulo) month mm, m

dayofyear dy, y
& (Bitwise AND) day dd, d

| (Bitwise OR) week wk, ww

^ (Bitwise Exclusive OR) hour hh

minute mi, n

~ (Bitwise NOT) second ss, s

= (Equals) millisecond ms

startdate
> (Greater Than) Is the beginning date for the calculation. startdate is an expression that returns a datetime value or a Unicode character string in a date format.

< (Less Than)


>= (Greater Than or Equal To) If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
<= (Less Than or Equal To) century that precedes the cutoff year. For example, if the two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is
interpreted as 1950. To avoid ambiguity, use four-digit years.
<> (Not Equal To)
!= (Not Equal To) For more information about specifying dates, see datetime in Data Types.
!< (Not Less Than) enddate
Is the ending date for the calculation. enddate is an expression that returns a datetime value or a Unicode character string in a date format.
!> (Not Greater Than)
@@IDENTITY
Return Types
ABS
ACOS
int
ALL
ALTER TABLE
AND Examples
ASIN
The following example uses the Northwind database. The example determines the number of days it took to ship the orders made by the company Vins et
ATAN alcohols Chevalier, which has a CustomerID of VINET.

ATN2
AVG SELECT OrderID, DATEDIFF (d, OrderDate, ShippedDate) AS "Shipping Time in Days" FROM Orders WHERE CustomerID =
'VINET'
BETWEEN
CASE This is the result set:

CEILING
CHARINDEX OrderID Shipping Time in Days
-------------------------------------
COALESCE 10295 8
10737 7
COLLATE 10274 10

CONVERT
10248 12
10739 5

COS
COT
COUNT
CREATE DATABASE
CREATE INDEX Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
CREATE TABLE
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
DATALENGTH

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datediff.asp (1 of 3) [23/07/2004 07:51:16 p.m.]


Welcome to the MSDN Library

Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datediff.asp (2 of 3) [23/07/2004 07:51:16 p.m.]


Welcome to the MSDN Library

UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datediff.asp (3 of 3) [23/07/2004 07:51:16 p.m.]


DATENAME (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


DATENAME

Returns a character string representing the specified datepart of the specified date.

Syntax

DATENAME ( datepart , date )

Arguments

datepart
Is the parameter that specifies the part of the date to return. The following table lists dateparts and abbreviations recognized by Microsoft® SQL
Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
year yy, yyyy

quarter qq, q

month mm, m

dayofyear dy, y

day dd, d

week wk, ww

weekday1 dw

hour hh

minute mi, n

second ss, s

millisecond ms

1 The weekday (dw) datepart returns the day of the week (such as Sunday or Monday).

date
Is an expression that returns a datetime value, or a value that can be implicitly converted to a datetime value. date can also be a Unicode
character string in a date format. Use the datetime data type for dates after January 1, 1753. Store them as character data for earlier dates.
When entering datetime values, always enclose them in single quotation marks. For more information about specifying dates, see datetime in
Data Types.

If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted
as 1950. To avoid ambiguity, use four-digit years.

Return Types

nvarchar

Remarks

SQL Server CE automatically converts between character and datetime values as necessary, for example, when you compare a character value with a
datetime value.

Examples

The following example extracts the month name from the date returned by GETDATE.

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datename.asp?frame=true (1 of 2) [24/07/2004 08:03:46 a.m.]


DATENAME (SQL Server CE Books Online)

CREATE TABLE MyOrders (OrderID int IDENTITY(100, 1) PRIMARY KEY, CompanyName nvarchar(50), OrderDate datetime)
INSERT INTO MyOrders (CompanyName, OrderDate) VALUES ('A. Datum Corporation', GETDATE())
SELECT DATENAME(month, OrderDate) AS "Month Name" FROM MyOrders

This is the result set:

Month Name
------------------------------
August

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datename.asp?frame=true (2 of 2) [24/07/2004 08:03:46 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
DATENAME

Returns a character string representing the specified datepart of the specified date.

Syntax
Up One Level
SQL Overview DATENAME ( datepart , date )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) datepart
Is the parameter that specifies the part of the date to return. The following table lists dateparts and abbreviations recognized by Microsoft® SQL
- (Negative) Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
* (Multiply)
year yy, yyyy

/ (Divide) quarter qq, q

% (Modulo) month mm, m

dayofyear dy, y
& (Bitwise AND) day dd, d

| (Bitwise OR) week wk, ww

^ (Bitwise Exclusive OR) weekday1 dw

hour hh
~ (Bitwise NOT) minute mi, n

= (Equals) second ss, s

> (Greater Than)


millisecond ms

< (Less Than)


1 The weekday (dw) datepart returns the day of the week (such as Sunday or Monday).
>= (Greater Than or Equal To)
<= (Less Than or Equal To)
date
<> (Not Equal To) Is an expression that returns a datetime value, or a value that can be implicitly converted to a datetime value. date can also be a Unicode
character string in a date format. Use the datetime data type for dates after January 1, 1753. Store them as character data for earlier dates.
!= (Not Equal To) When entering datetime values, always enclose them in single quotation marks. For more information about specifying dates, see datetime in
Data Types.
!< (Not Less Than)
!> (Not Greater Than) If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
@@IDENTITY configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted
ABS as 1950. To avoid ambiguity, use four-digit years.

ACOS
ALL Return Types
ALTER TABLE
AND nvarchar

ASIN
ATAN Remarks
ATN2
AVG SQL Server CE automatically converts between character and datetime values as necessary, for example, when you compare a character value with a
datetime value.
BETWEEN
CASE
Examples
CEILING
CHARINDEX
The following example extracts the month name from the date returned by GETDATE.
COALESCE
COLLATE CREATE TABLE MyOrders (OrderID int IDENTITY(100, 1) PRIMARY KEY, CompanyName nvarchar(50), OrderDate datetime)
CONVERT INSERT INTO MyOrders (CompanyName, OrderDate) VALUES ('A. Datum Corporation', GETDATE())
SELECT DATENAME(month, OrderDate) AS "Month Name" FROM MyOrders
COS
COT This is the result set:

COUNT
CREATE DATABASE Month Name
------------------------------
CREATE INDEX August

CREATE TABLE
DATALENGTH

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datename.asp (1 of 3) [24/07/2004 08:03:49 a.m.]


Welcome to the MSDN Library

Data Types
DATEADD
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
DATEDIFF
DATENAME ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT
Operators
OR
ORDER BY Clause
PATINDEX
PI
POWER
RADIANS
RAND
REPLACE
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datename.asp (2 of 3) [24/07/2004 08:03:49 a.m.]


Welcome to the MSDN Library

UPPER
WHERE Clause

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datename.asp (3 of 3) [24/07/2004 08:03:49 a.m.]


DATEPART (SQL Server CE Books Online)

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

SQL Server CE Books Online


DATEPART

Returns an integer representing the specified datepart of the specified date.

Syntax

DATEPART ( datepart , date )

Arguments

datepart
Is the parameter that specifies the part of the date to return. The following table lists dateparts and abbreviations recognized by Microsoft® SQL
Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
year yy, yyyy

quarter qq, q

month mm, m

dayofyear dy, y

day dd, d

week wk, ww

weekday dw

hour hh

minute mi, n

second ss, s

millisecond ms

date
Is an expression that returns a datetime value, or a value that can be implicitly converted to a datetime value. date can also be a character
string in a date format. Use the datetime data type only for dates after January 1, 1753. Store dates as character data for earlier dates. When
entering datetime values, always enclose them in single quotation marks.

If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted
as 1950. To avoid ambiguity, use four-digit years.

For more information about specifying dates, see datetime in Data Types.

Return Types

int

Examples

The following example assumes the current month is August.

CREATE TABLE MyOrders (OrderID int IDENTITY(100, 1) PRIMARY KEY, CompanyName nvarchar(50), OrderDate datetime)
INSERT INTO MyOrders (CompanyName, OrderDate) VALUES ('A. Datum Corporation', GETDATE())
SELECT DATEPART(month, OrderDate) FROM MyOrders

This is the result set:

-----------

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datepart.asp?frame=true (1 of 2) [24/07/2004 08:04:01 a.m.]


DATEPART (SQL Server CE Books Online)

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter

©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement

http://msdn.microsoft.com/library/en-us/sqlce/htm/_lce_datepart.asp?frame=true (2 of 2) [24/07/2004 08:04:01 a.m.]


Welcome to the MSDN Library
Microsoft.com Home | Site Map

MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide

Search for Welcome to the MSDN Library

MSDN Home > MSDN Library > Enterprise Development > Windows Server System > Microsoft SQL Server > SQL Server 2000 Windows CE Edition > Microsoft SQL
MSDN Library Go Server 2000 Windows CE Edition 2.0 > SQL Reference for SQL Server CE

Advanced Search
SQL Server CE Books Online
DATEPART

Returns an integer representing the specified datepart of the specified date.

Syntax
Up One Level
SQL Overview DATEPART ( datepart , date )

+ (Add)
+ (Positive) Arguments
+ (String Concatenation)
- (Subtract) datepart
Is the parameter that specifies the part of the date to return. The following table lists dateparts and abbreviations recognized by Microsoft® SQL
- (Negative) Server™ 2000 Windows® CE Edition (SQL Server CE).
Datepart Abbreviations
* (Multiply)
year yy, yyyy

/ (Divide) quarter qq, q

% (Modulo) month mm, m

dayofyear dy, y
& (Bitwise AND) day dd, d

| (Bitwise OR) week wk, ww

^ (Bitwise Exclusive OR) weekday dw

hour hh

~ (Bitwise NOT) minute mi, n

= (Equals) second ss, s

> (Greater Than)


millisecond ms

date
< (Less Than) Is an expression that returns a datetime value, or a value that can be implicitly converted to a datetime value. date can also be a character
string in a date format. Use the datetime data type only for dates after January 1, 1753. Store dates as character data for earlier dates. When
>= (Greater Than or Equal To) entering datetime values, always enclose them in single quotation marks.

<= (Less Than or Equal To)


If you specify only the last two digits of the year, values less than or equal to the last two digits of the value of the two digit year cutoff
<> (Not Equal To) configuration option are in the same century as the cutoff year. Values greater than the last two digits of the value of this option are in the
century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted
!= (Not Equal To) as 1950. To avoid ambiguity, use four-digit years.

!< (Not Less Than)


!> (Not Greater Than) For more information about specifying dates, see datetime in Data Types.

@@IDENTITY
ABS Return Types
ACOS
ALL int

ALTER TABLE
AND
Examples
ASIN
ATAN The following example assumes the current month is August.
ATN2
AVG CREATE TABLE MyOrders (OrderID int IDENTITY(100, 1) PRIMARY KEY, CompanyName nvarchar(50), OrderDate datetime)

BETWEEN
INSERT INTO MyOrders (CompanyName, OrderDate) VALUES ('A. Datum Corporation', GETDATE())
SELECT DATEPART(month, OrderDate) FROM MyOrders

CASE
CEILING This is the result set:

CHARINDEX
COALESCE -----------
8
COLLATE
CONVERT
COS
COT
COUNT
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
CREATE DATABASE
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
CREATE INDEX
CREATE TABLE
DATALENGTH

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_datepart.asp (1 of 3) [24/07/2004 08:04:04 a.m.]


Welcome to the MSDN Library

Data Types
DATEADD
DATEDIFF
DATENAME
DATEPART
DDL Statements
DEGREES
DELETE
DML Statements
DROP INDEX
DROP TABLE
EXISTS
EXP
Expressions
FLOOR
FROM Clause
Functions
GETDATE
GROUP BY Clause
HAVING Clause
IDENTITY (Property)
IN
Information Schema
INSERT
IS [NOT] NULL
LEN
LIKE
LOG
LOG10
LOWER
LTRIM
MAX
MIN
NCHAR
NEWID
NOT