SCOPE Element

SCOPE Element

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release. The Structured Query Language (SQL) SCOPE element is an optional part of the SQLFROM Predicate and is used to specify the location and depth of a search.

Syntax

FROM SCOPE('[shallow|deep|hierarchical] traversal of "URL"')

A shallow traversal search examines the resources in the specified folder, but not in any of the subfolders.

Specifying deep traversal in the SCOPE element executes a search against any and all subfolders of the given folder, all the way to the bottom of the folder hierarchy.

A hierarchical traversal search is executed only against folder resources in a specified folder. A hierarchical traversal search can be used for a task such as determining the folder hierarchy of a specified folder.

"URL" is the URL of a folder in an Exchange store to be searched.

See Search Scope for more information.

Example

The following is an example of a shallow traversal search, where "URL" is a string containing the URL of the folder to be searched, and "sender" is a string containing the name of a sender.

'construct the SQL query
strQ = "SELECT ""urn:httpmail:subject"" "
strQ = strQ & "FROM scope('shallow traversal of """ & strURL & """ ')"
strQ = strQ & "WHERE ""urn:schemas:httpmail:sendername"" = '" & sender & "'"

Remarks

If the SCOPE Statement is omitted from the FROM Predicate, the search scope defaults to shallow traversal.

A deep traversal search cannot be performed against a MAPI store, such as the default public store installed by Microsoft Exchange Server 2003.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.