Skip to Content
Inside Microsoft® SQL Server™ 2005
book

Inside Microsoft® SQL Server™ 2005

by Itzik Ben-Gan, Lubor Kollar, Dejan Sarka
May 2006
Intermediate to advanced
536 pages
15h 13m
English
Microsoft Press
Content preview from Inside Microsoft® SQL Server™ 2005

Table Variables

Table variables are probably among the least understood T-SQL elements. Many myths and misconceptions surround them, and these are embraced even by experienced T-SQL programmers. One widespread myth is that table variables are memory-resident only with no physical representation. Another is that table variables are always preferable to temporary tables. In this section, I’ll dispel these myths and explain the scenarios in which table variables are preferable to temporary tables as well as scenarios in which they aren’t preferable. I’ll do so by first going through the fundamentals of table variables, just as I did with temporary tables, and follow with tangible examples.

You create a table variable using a DECLARE statement, followed ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® SQL Server® 2008 For Dummies®

Microsoft® SQL Server® 2008 For Dummies®

Mike Chapple
Microsoft® SQL Server® 2008 Bible

Microsoft® SQL Server® 2008 Bible

Paul Nielsen, Mike White, Uttam Parui
A Developer’s Guide to SQL Server 2005

A Developer’s Guide to SQL Server 2005

Bob Beauchemin, Dan Sullivan
Microsoft® SQL Server® 2008 Internals

Microsoft® SQL Server® 2008 Internals

Paul Randal Kalen Delaney Kimberly Tripp, and Conor Cunningham

Publisher Resources

ISBN: 0735621977Supplemental ContentErrata