The type of query is SELECT (into a worktable)

This statement indicates that SQL Server needs to insert some of the query results into an intermediate worktable, and later in the query processing will then select values from that table. This statement is most often seen with a query that involves a GROUP BY clause; the results are first put into a work table, and then the qualifying rows in the work table are grouped based on the given column in the GROUP BY clause.

The following query returns a list of all cities and indicates the number of authors who live in each city. The query plan is composed of two steps: the first step selects the rows into a worktable, and the second step retrieves the grouped rows from the worktable:

Query:

SELECT city, total_authors = count(*)
FROM Authors
GROUP BY city

SHOWPLAN:

STEP 1
The type of query is SELECT (into a worktable)
GROUP BY
Vector Aggregate
FROM TABLE
authors
Nested iteration
Table Scan
TO TABLE
Worktable 1

STEP 2
The type of query is SELECT
FROM TABLE
Worktable 1
Nested iteration
Table Scan