|
Part 1 | Part 2 | Part 3 | Part 4 | part 5 |
part 6 | part 7 | part 8 | part
9
QUESTION - Define Local temporary
table and global temporary table.
ANSWER
- Local temporary table is created by prefixing name
with pound sign like (#table_name). Global temporary table is
created by prefixing name with Double pound sign like
(##table_name). Local temporary table is dropped when the
stored procedure completes. Global temporary tables are
dropped when session that created the table ends.
QUESTION - When do we use
the UPDATE_STATISTICS command? ANSWER -
UPDATE_STATISTICS updates the indexes on the tables
when there is large processing of data. If we do a large
amount of deletions any modification or Bulk Copy into the
tables, we need to basically update the indexes to take these
changes into account.
QUESTION - Difference between
clustered and non-clustered index. ANSWER - Both
stored as B-tree structure. The leaf level of a clustered
index is the actual data where as leaf level of a
non-clustered index is pointer to data. We can have only one
clustered index in a table but we can have many non-clustered
index in a table. Physical data in the table is sorted in the
order of clustered index while not with the case of
non-clustered data.
|