Not surprise you will see this “table”  if you put the statement “set STATISTICS  io on ” before run the query. So what is “Worktable” table?

According to msdn, worktables are internal tables that are used to hold intermediate results. Worktables are generated for certain GROUP BY, ORDER BY, or UNION queries. For example, if an ORDER BY clause references columns that are not covered by any indexes, the relational engine may need to generate a worktable to sort the result set into the order requested.

Worktables are also sometimes used as spools that temporarily hold the result of executing a part of a query plan. Worktables are built in tempdb and are dropped automatically when they are no longer needed.

SQL-Server-2012

Advertisements