Tempoary table is similar to parmanent table .It is create in TempDB You can create or drop it .It is automatically drop when it is no longer used or closed connection .
Two type Temp Table :
a. Local Temp
b.Global Temp
IN SQL SERVER:
#CREATE TABLE #EMP_DETAIL (ID INT ,NAME VARCHAR(10))
Global Temp :It is visible of all the connection and destoryed when lost connection it will drop table.
#CREATE TABLE ##EMP_DETAIL (ID INT ,NAME VARCHAR(10))
IN MYSQL:
Exp :1
#CREATE TEMPORARY TABLE tbl_TEMP (ID INT , NAME VARCHAR(10))
Exp: 2
#CREATE TEMPORARY TABLE tbl_TEMP SELECT * FROM EMP_DETAILS
#DROP TEMPORARY TABLE tbl_TEMP ;
No comments:
Post a Comment