What are the temporary tables?

The concept behind the temporary table is very simple and it is also an interview question?

Types of temporary tables?

The temporary tables are two types they are as follows.

  • Local temporary tables
  • Global temporary tables
Local temporary tables:
  • Prefixed with # (single pound)
  • Visible to only session of the server
  • Dropped automatically if you close the session.
Global temporary tables:

  • Prefixed with ## (two pounds)
  • Visible to all the sessions of the server
  • Dropped automatically if you close the session.
Note

We can not create foreign key on temporary tables. Mainly we cannot delete these tables, but sometimes its better drop explicitly if connection pooling is enabled.






2 comments:

  1. Can u explain what is union?

    ReplyDelete
    Replies
    1. Please check it here.

      http://9saireddy.blogspot.in/2017/03/what-is-difference-between-union-and.html

      Delete

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...