SQL Server: Are temp tables or unions better?

Posted by Jonathan Allen on Stack Overflow See other posts from Stack Overflow or by Jonathan Allen
Published on 2010-04-14T07:33:31Z Indexed on 2010/04/14 8:02 UTC
Read the original article Hit count: 356

Filed under:

Generally speaking, for combining a lot of data is it better to use a temp table/temp variable as a staging area or should I just stick to "UNION ALL"?

Assumptions:

  • No further processing is needed, the results are sent directly to the client.
  • The client waits for the complete recordset, so streaming results isn't necessary.

© Stack Overflow or respective owner

Related posts about sql-server