CREATE CACHE

The CREATE CACHE statement allows you to populate the cache with a slice of cube data defined by sets of members.

You can define cache for use by a single query with the WITH clause in the SELECT statement, or for use by multiple queries in a session with the CREATE CACHE statement. For more information about WITH, see Using WITH to Define Calculated Members, Sets, and Cache.

BNF

<create-cache-statement> ::= CREATE <optional-scope> <create-cache-subset> [<create-cache-subset>...]

<create-cache-subset> ::= CACHE FOR <cube-name> AS '(<set-expression> [,<set-expression>...])'

<optional-scope> ::= <empty> | SESSION

Remarks

Each <set-expression> must contain members from only one dimension. Each member must be distinct.

Each <set-expression> must be from a different dimension.

The <set-expression> can contain functions that support MDX syntax.

The <set-expression> cannot contain measures.

Cache created with CREATE CACHE without an <optional-scope> value has session scope.

Example

CREATE SESSION CACHE FOR Warehouse AS '({USA,Canada})'

Scope

Cache can occur within one of two scopes:

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.