Skip to content

Commit 1251b47

Browse files
erikdarlingdatarwestMSFT
authored andcommitted
Update with-common-table-expression-transact-sql.md
@rwestMSFT might could use some tidying but I'm sure it's in good hands now.
1 parent bd56b73 commit 1251b47

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/t-sql/queries/with-common-table-expression-transact-sql.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The following guidelines apply to nonrecursive common table expressions. For gui
7979

8080
- The following clauses can't be used in the *CTE_query_definition*:
8181

82-
- `ORDER BY` (except when a `TOP` clause is specified)
82+
- `ORDER BY` (except when a `TOP` or `OFFSET/FETCH` clause is specified)
8383

8484
- `INTO`
8585

@@ -95,6 +95,14 @@ The following guidelines apply to nonrecursive common table expressions. For gui
9595

9696
- When executing a CTE, any hints that reference a CTE can conflict with other hints that are discovered when the CTE accesses its underlying tables, in the same manner as hints that reference views in queries. When this occurs, the query returns an error.
9797

98+
## Limitations
99+
100+
- Query results from common table expressions are not materialized. Each outer reference to the named result set requires the defined query to be re-executed. For queries that require multiple references to the named result set, consider using a temporary object instead.
101+
102+
- You cannot execute a stored procedure in a common table expression.
103+
104+
- Do not use common table expressions if you are allergic to common table expressions.;
105+
98106
## Guidelines for defining and using recursive common table expressions
99107

100108
The following guidelines apply to defining a recursive common table expression:

0 commit comments

Comments
 (0)