SQL Server CE
SQL Server CE
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
MSDN Online
Microsoft TechNet
Samples
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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 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.
Installing SQL Server CE Query Analyzer Describes installing SQL Server CE Query Analyzer on a Windows CE-based device.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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:
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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.
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):
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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).
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.
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.
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) provides:
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.
Development Environment
●
● Transaction support.
● Referential integrity.
128-bit file-level encryption and password protection.
SQL Server CE Database Engine
●
For more information about the SQL Server CE database engine, see Working with SQL
Server CE Databases.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) supports two
methods of connecting to and exchanging data with a data source:
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.
Merge Replication
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
●
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
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Microsoft SQL Server system For more information, see "Installing SQL Server" in SQL Server Books Online.
Microsoft Internet Information Services (IIS) system 120 MB of available disk space.
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 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.
Component Requirements
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
See Also
Deploying Applications
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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).
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
●
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.
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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 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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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).
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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.
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.
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.
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.
Adoceoledb31.dll Required.
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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.
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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.
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.
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:
Sscerelay /unregister
del sscerelay.exe
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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:
Sscerelay /unregister
del sscerelay.exe
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 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.
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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 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.
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.
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
Using SQL Server CE Relay Provides information about installing and configuring SQL Server CE Relay when you are using Microsoft ActiveSync® 3.1.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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
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 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 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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
This topic describes how Microsoft® SQL Server® 2000 Windows® CE Edition (SQL Server
CE) relies on:
● IIS Encryption
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.
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.
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 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.
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.
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
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
This topic describes how Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) works with:
● 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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
This topic describes how Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server
CE) works with:
● Windows Authentication
● SQL Server Authentication
Windows Authentication
● 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.
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.
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
information, see Configuring the Check Permissions Option.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
● 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.
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.
For information about using the SQL Server CE Connectivity Management utility to manage
existing virtual directories, see Modifying an Existing Virtual Directory.
See Also
Managing Connectivity
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
●
Virtual Directory Authentication
NTFS Permissions: User
● NTFS Permissions: Computer Running SQL Server
● NTFS Permissions: Snapshot Folder
See Also
Managing Connectivity
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
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
● Anonymous access
● Basic authentication
● Integrated Windows authentication
● 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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
●
Anonymous access
Basic authentication
Integrated Windows authentication
NTFS Permissions: Snapshot Folder
●
● 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.
● 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.
● 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
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
You must add NTFS permissions if either or both of the following states exist:
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.
● 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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
●
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.
● 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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
For more information about snapshot folders, see Configuring the Snapshot Folder.
See Also
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
See Also
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
For more information about these options, see Virtual Directory Authentication and IIS
Security.
See Also
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
This page in the NTFS Permissions Wizard is functionally identical to the NTFS Permissions: Snapshot Folder page
SQL Server CE Virtual Directory Creation Wizard.
See Also
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)
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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)
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
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)
For more information about snapshot folders, see Configuring the Snapshot Folder.
See Also
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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)
For more information about snapshot folders, see Configuring the Snapshot Folder.
See Also
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
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.
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:
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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:
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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 Microsoft® Internet Information Services (IIS) for either replication or RDA involves the following steps:
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.
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
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Up One Level Configuring Microsoft® Internet Information Services (IIS) for either replication or RDA involves the following steps:
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
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
The SSL features in IIS cannot be used until you obtain and assign a server
certificate to the computer running IIS.
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.
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
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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.
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 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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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 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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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:
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).
Note For more information about configuring IIS and SQL Server for connectivity, see Planning for Security.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
The client port and server port configurations are very important for Relay to function correctly.
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.
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.
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.
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.
See Also
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
The client port and server port configurations are very important for Relay to function
correctly.
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.
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.
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.
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.
See Also
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
See Also
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
See Also
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
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.
/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.
/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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
/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.
/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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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.
● 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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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:
● 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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
When an ActiveSync connection is made, it starts Relay with the parameters that were
specified when Relay was configured.
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:
● 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.
Use the /unregister option at the command prompt to unregister Relay from ActiveSync,
as shown here:
sscerelay /unregister
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Using the /stop option at the command prompt halts all instances of Relay that are
running.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.
Sessions 1
Columns in an index 10
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
Sessions 1
Columns in an index 10
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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):
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
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
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:
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
See Also
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
● Interim sort tables that are created when executing an ORDER BY clause.
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:
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.
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
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.
conn.Open();
The following Microsoft Visual Basic® example shows how to pass the temporary database location in the connection string of the SqlCeConnection
object.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
conn.Open();
The following Microsoft Visual Basic® example shows how to pass the temporary
database location in the connection string of the SqlCeConnection object.
conn.Open()
See Also
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Specifying the Location of the Temporary Database Using the Replication and RDA Controls
"SSCE:Temp File Directory = temp_database_location"
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
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
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
The following Microsoft Visual Basic® example shows how to use the SubscriberConnectionString property in the SQL Server CE ActiveX Control Replication
object.
The following Visual Basic example shows how to use the LocalConnectionString property in the SQL Server CE RDA ActiveX control object.
' 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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
The following Microsoft Visual Basic® example shows how to use the SubscriberConnectionString property in the SQL Server
CE ActiveX Control Replication object.
The following Visual Basic example shows how to use the LocalConnectionString property in the SQL Server CE RDA ActiveX
control object.
' 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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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.
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:
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:
● 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:
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:
● Using OLE DB
A password must be supplied to open a password-protected database. Password-protected databases can be accessed by the following methods:
To access a password-protected database using the SqlCeConnection.Open method, you must specify the password property in the connection string. For example:
For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual Studio .NET.
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:
● Using OLE DB
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
SubscriberConnectionString Property
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
● 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:
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:
● Using OLE DB
To access a password-protected database using the SqlCeConnection.Open method, you must specify the password
property in the connection string. For example:
For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework
SDK in Microsoft Visual Studio .NET.
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:
● Using OLE DB
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
SubscriberConnectionString Property
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
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.
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:
To create an encrypted database through SQL syntax, specify both database_password and the ENCRYPTION ON option. For example:
● 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:
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:
● Using OLE DB
A password must be supplied to open an encrypted database. Encrypted databases can be accessed by the following methods:
To access a password-protected database using the SqlCeConnection.Open method, you must specify the password property in the connection string. For example:
For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual Studio® .NET.
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:
● Using OLE DB
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
SubscriberConnectionString Property
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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:
To create an encrypted database through SQL syntax, specify both database_password and the ENCRYPTION ON option. For example:
● 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:
● 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:
● Using OLE DB
A password must be supplied to open an encrypted database. Encrypted databases can be accessed by the
following methods:
To access a password-protected database using the SqlCeConnection.Open method, you must specify the password property in the connection
string. For example:
For more information, see the System.Data.SqlServerCe.SqlCeConnection class in the .NET Compact Framework SDK in Microsoft Visual
Studio® .NET.
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:
● Using OLE DB
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
SubscriberConnectionString Property
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
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.
● The Compact method of the System.Data.Sqlserverce.SqlCeEngine class of the .NET Compact Framework Data Provider for SQL Server CE.
● Directly through the OLE DB for SQL Server CE by using the ISSCECompact interface.
Note When compacting a password protected or encrypted database, you will need to specify the password for the original database.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
● The Compact method of the System.Data.Sqlserverce.SqlCeEngine class of the .NET Compact Framework Data
Provider for SQL Server CE.
● Directly through the OLE DB for SQL Server CE by using the ISSCECompact interface.
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
● 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 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.
● Password
See Also
CompactDatabase Method
ISSCECompact
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
●
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 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.
● Password
● Whether or not the database is encrypted
● Locale identifier
See Also
CompactDatabase Method
ISSCECompact
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
The Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) database engine
provides the following features for accessing SQL Server CE databases:
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.
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.
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
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
In the following simple statement using the Northwind sample database, the requested value for CustomerID is passed programmatically when the
SELECT statement is executed.
In the following example, an SQL INSERT statement uses parameters to insert a new row into the Employees table of the Northwind sample database.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
In the following simple statement using the Northwind sample database, the requested
value for CustomerID is passed programmatically when the SELECT statement is executed.
In the following example, an SQL INSERT statement uses parameters to insert a new row
into the Employees table of the Northwind sample database.
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
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
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 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:
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
Cursors
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
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.
rs.Open "SELECT * FROM tablename WHERE col1 > 2;", cn, adOpenForwardOnly, adLockOptimistic
See Also
Cursors
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
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:
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")
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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")
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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 Query Analyzer is a graphical tool included in Microsoft® SQL Server™ 2000
Windows® CE Edition (SQL Server CE) that you can use to:
●
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
●
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
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.
● 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:
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
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.
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 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 is available only in the SQL tab. For more information about the SQL menu, see Executing SQL Statements in the SQL Tab.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
When you start SQL Server CE Query Analyzer, the query window contains the following
tabs: Objects, SQL, Grid, and Notes.
● Indexes
● System tables (view only)
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 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 is available only in the SQL tab. For more information about the SQL menu,
see Executing SQL Statements in the SQL Tab.
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
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.
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.
● 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.
● 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.
To remove all databases from the list of managed databases in the Databases folder
For information about compacting and repairing a database, see Maintaining SQL Server CE Databases.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
Managing Database Objects in the Objects Tab Indicates no current connection to the database. Tap to connect.
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.
● 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.
● 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.
To remove all databases from the list of managed databases in the Databases folder
For information about compacting and repairing a database, see Maintaining SQL Server CE Databases.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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.
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.
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.
For information about the data types that SQL Server CE supports, see Data Types.
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.
● In the Objects tab, connect to a database, select the Tables folder, and then tap the system table button.
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.
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 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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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).
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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).
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
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.
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.
● On the SQL menu, tap New. This clears all text from the SQL tab to start a new 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 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.
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.
1. In the SQL tab, select the text you want to save, and then tap the preset button.
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.
● 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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
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.
● On the SQL menu, tap New. This clears all text from the SQL tab to start a new 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 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.
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.
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.
● 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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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).
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
Implementing RDA
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
● 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.
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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.
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
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
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 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 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 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
Connectivity Solutions
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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 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 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
Connectivity Solutions
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
●
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
bit bit
datetime datetime
float float
image image
money money
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, pushing tracked data back to SQL Server fails.
smallmoney money
If the precision of the money data exceeds the precision of the smallmoney column, pushing tracked data back to SQL Server fails.
text ntext
If the length of the text data exceeds 1,073,741,823 characters, pulling data from SQL Server fails.
uniqueidentifier uniqueidentifier
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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)
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
datetime datetime
float float
image image
money money
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, pushing tracked data back to SQL Server fails.
smallmoney money
If the precision of the money data exceeds the precision of the smallmoney column, pushing tracked data back to SQL Server fails.
text ntext
If the length of the text data exceeds 1,073,741,823 characters, pulling data from SQL Server fails.
uniqueidentifier uniqueidentifier
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
RDA Limitations
Remote data access (RDA) in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has the following limitations:
● Case sensitivity
● 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.
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:
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:
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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.
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:
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:
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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)
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.
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.
See Also
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
See Also
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
Implementing Replication
Replication
Troubleshooting
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
● 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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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.
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
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
Replication Architecture
Replication uses the following components in Microsoft® SQL Server™ 2000 Windows CE Edition (SQL Server CE):
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.
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.
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Replication Architecture
Replication uses the following components in Microsoft® SQL Server™ 2000 Windows CE Edition (SQL Server CE):
Replication Architecture
How Replication Works
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.
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.
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.)
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.
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.
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:
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.)
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.
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.
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:
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.
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
When you create a publication for SQL Server CE Subscribers by using the Create Publication Wizard, it is important to select the following options:
By selecting Devices running Windows CE, the following options are automatically configured for the publication:
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
By selecting Devices running Windows CE, the following options are automatically
configured for the publication:
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.
See Also
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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 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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
● 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
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
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.
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.
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
If the Snapshot Agent for the publication has not started, in the right pane, right-click the
agent entry and select Start Agent.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
●
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
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.
The following basic configuration rules govern SQL Server CE replication configuration:
Individual Subscribers cannot be assigned a merge replication conflict resolution priority; the priority for Subscribers is always 0.
Two or more Windows CE-based devices can share a publication only by subscribing to the same SQL Server 2000 publication.
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.
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.
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.
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).
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
Replication Conflict Detection and Resolution The configuration you choose is influenced by the security requirements of the application you develop.
The following basic configuration rules govern SQL Server CE replication configuration:
Individual Subscribers cannot be assigned a merge replication conflict resolution priority; the priority for Subscribers is always 0.
Two or more Windows CE-based devices can share a publication only by subscribing to the same SQL Server 2000 publication.
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.
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.
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.
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).
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
bit bit
datetime datetime
float float
image image
money money
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.
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.
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.
uniqueidentifier uniqueidentifier
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Up One Level SQL Server data type SQL Server CE data type
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
datetime datetime
float float
image image
money money
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.
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.
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.
uniqueidentifier uniqueidentifier
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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:
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.
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.
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:
Set the @snapshot_in_defaultfolder option to FALSE and @alt_snapshot_folder= location of the alternate folder for the snapshot.
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.
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.
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.
For all replication tables, the number of available columns is 252 (255 – 3 system columns). SQL Server CE allocates three system columns for tracking.
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)
ReinitializeSubscription Method
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
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.
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:
Set the @snapshot_in_defaultfolder option to FALSE and @alt_snapshot_folder= location of the alternate
folder for the snapshot.
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.
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.
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.
For all replication tables, the number of available columns is 252 (255 – 3 system columns). SQL Server CE
allocates three system columns for tracking.
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)
ReinitializeSubscription Method
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
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.
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
You can add articles to an existing publication. When an article is added, the SQL Server CE
Subscriber must be reinitialized.
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
- (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
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
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
UPPER
WHERE Clause
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
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
| (vertical bar) Separating syntax items within brackets or braces. You can choose only one of the items.
[,...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.
● Multiple-word identifiers
● Reserved words used as identifiers
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
| (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.
/ (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.
@@IDENTITY ● table_name.object_name
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
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
UPPER
WHERE Clause
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
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.
Target Total
------------
140
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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:
ABS
ACOS
ALL
ALTER TABLE
AND
ASIN
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
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
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
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'.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
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
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
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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
ACOS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |
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
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
UPPER
WHERE Clause
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
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'.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
ABS ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |
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
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
UPPER
WHERE Clause
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
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'.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
!< (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
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
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
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
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'
Total Cost
----------
168
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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)
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.
ALTER TABLE ©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
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
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
UPPER
WHERE Clause
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
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'
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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)
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.
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
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
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
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
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.
EmployeeID LastName #2
---------- -------- ---
2 Fuller 0
4 Peacock 0
6 Suyama 0
8 Callahan 0
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
ALL
ALTER TABLE
AND
ASIN
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
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
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
Syntax
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
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
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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
UPPER
WHERE Clause
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
UPPER
WHERE Clause
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
UPPER
WHERE Clause
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
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
Tests whether one expression is not equal to another expression (a comparison operator). Functions the same as Not Equal To (<>).
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
UPPER
WHERE Clause
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
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
UPPER
WHERE Clause
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
Syntax
@@IDENTITY
Return Types
numeric
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
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.
real/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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
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
UPPER
WHERE Clause
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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)
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
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
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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
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
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
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
Syntax
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}
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.
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.
n
Is a placeholder indicating that the preceding item can be repeated n number of times.
Examples
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)
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'
The following example modifies the CompanyName column so that it does not have a default value.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
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
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
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
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
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'
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
+ (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.
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
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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)
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
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
REPLICATE
Reserved Words
ROUND
RTRIM
SELECT Statement
SIGN
SIN
SOME | ANY
SPACE
SQRT
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause
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
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
= (Equals)
> (Greater Than) CREATE TABLE Atangent ("TAN(0)" float, "TAN(PI()/6)" float, "TAN(PI()/4)" float, "TAN(PI()/3)" float,
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
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
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
Returns the average of the values in a group. Null values are ignored.
Syntax
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.
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.
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
@@IDENTITY
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
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
UPPER
WHERE Clause
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
Syntax
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'
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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
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
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
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
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
Evaluates a list of conditions and returns one of multiple possible result expressions.
● 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.
Syntax
CASE input_expression
WHEN when_expression THEN result_expression
[ ...n ]
[
ELSE else_result_expression
]
END
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.
Result Values
● 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.
Examples
The following example returns the mode of shipping used for orders placed in the Northwind database.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Evaluates a list of conditions and returns one of multiple possible result expressions.
● 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:
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
●
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
●
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
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
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
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.
real/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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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.
= (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
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
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
UPPER
WHERE Clause
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
Syntax
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.
LastName..............Position
------------------------------
Fuller................0
Peacock...............0
Callahan..............7
Davolio...............0
Leverling.............0
Buchanan..............5
Suyama................0
King..................0
Dodsworth.............0
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
ACOS
ALL LastName..............Position
------------------------------
ALTER TABLE Fuller................0
Peacock...............0
AND Callahan..............7
Davolio...............0
ASIN Leverling.............0
Buchanan..............5
Suyama................0
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
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
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
Syntax
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
ATN2
AVG
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
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
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
Syntax
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:
The following table lists the supported Windows collation names. Ensure that the locale is supported on the device on which the database is created.
Cp/Collation Unique LCID Windows collation name Identical LCID group Supported Windows locales
1250 0x0000041C Albanian Albanian
1251 0x00000419 Cyrillic_General 0x00000402, 0x00000423, 0x00000C1A, Bulgarian, Byelorussian, Russian, Serbian
0x0000081A
1252 0x00000406 Danish_Norwegian 0x00000414, 0x00000814 Danish, Norwegian (Bokml), Norwegian (Nyorsk)
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
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
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)
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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.
BETWEEN
1250 0x00000418 Romanian Romanian
COALESCE
1251 0x0000042f FYRO Macedonian FYRO Macedonian
CONVERT 1252 0x00000406 Danish_Norwegian 0x00000414, 0x00000814 Danish, Norwegian (Bokml), Norwegian (Nyorsk)
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),
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
DELETE
1257 0x00000425 Estonian Estonian
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)
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
STR
STUFF
SUBSTRING
SUM
TAN
UNICODE
UNION
UPDATE
UPPER
WHERE Clause
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
Syntax
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).
6 106 - dd mon yy
8 108 - hh:mm:ss
14 114 - hh:mi:ss:mmm(24h)
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.
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
Remarks
Examples
The following example converts a datetime value in the Northwind database to an nvarchar value.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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)
8 108 - hh:mm:ss
!> (Not Greater Than) - 9 or 109 1 Default + milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM)
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.
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
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
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
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
Syntax
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.
Total Discontinued
--------------------
8
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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.
ABS
ACOS Total Discontinued
--------------------
ALL 8
ALTER TABLE
AND
ASIN
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
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
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
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
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
When a user tries to connect to a password-protected database without supplying the correct password, SQL Server CE returns this error:
The following example specifies a specific collation for the database being created.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
Creates a new database and the file used to store the database.
+ (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>'
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 |
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
UPPER
WHERE Clause
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
Syntax
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
/ (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
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
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
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
Syntax
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.
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.
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
DEFAULT Definitions
A column can have only one DEFAULT definition, which can contain constant values or constant functions.
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.
The following example creates a table with one of its columns referencing a column in another table.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
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
●
The following example creates a one-column table with a PRIMARY KEY constraint.
The following example creates a table with one of its columns referencing a column in another table.
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
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
+ (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
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
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
UPPER
WHERE Clause
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
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.
integer Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).
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
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.
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.
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.
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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).
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 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.
@@IDENTITY
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
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
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
UPPER
WHERE Clause
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
Returns a new datetime value based on adding an interval to the specified date.
Syntax
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
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
dayofyear dy, y
& (Bitwise AND) day dd, d
minute mi, n
= (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.
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
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
UPPER
WHERE Clause
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
Returns the number of date and time boundaries crossed between two specified dates.
Syntax
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'
10737 7
10274 10
10248 12
10739 5
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
dayofyear dy, y
& (Bitwise AND) day dd, d
minute mi, n
= (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.
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
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
UPPER
WHERE Clause
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
Returns a character string representing the specified datepart of the specified date.
Syntax
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.
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
Month Name
------------------------------
August
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
dayofyear dy, y
& (Bitwise AND) day dd, d
hour hh
~ (Bitwise NOT) minute mi, n
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
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
UPPER
WHERE Clause
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
Syntax
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
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
-----------
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
MSDN Home
| Developer Centers | Library | Downloads | Code Center | Subscriptions | MSDN Worldwide
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
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
dayofyear dy, y
& (Bitwise AND) day dd, d
hour hh
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.
@@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
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