CHAPTER 10
Programmable Objects
353
Temporary Tables
When you need to temporarily store data in tables, in certain cases you might prefer not to work
with permanent tables. Suppose you need the data to be visible only to the current session, or even
only to the current batch. As an example, suppose that you need to store temporary data during data
processing, as in the cursor example in the previous section.
SQL Server supports three kinds of temporary tables that you might find more convenient to work
with than permanent tables in such cases: local temporary tables, global temporary tables, and table
variables. The following sections describe the three kinds and demonstrate their use with code samples.
Do'stlaringiz bilan baham: |