ajeet verma
How many types of Temporary Tables.
By ajeet verma in Databases & DBA on Jul 16 2015
  • Sourabh Somani
    Nov, 2015 15

    There are two types of temporary table.1.Local Temporary Table: These are only available for the current instance, it will be automatically deleted when the user is disconnected from the instance. To create a local temporary table we use the table name with a # (hash) prefix.2.Global Temporary Table: This table is the same as a permanent table but the difference is only that when all the connections are closed or all the instances are deleted then the table will be deleted. To create a local temporary table we use a table name with a ## (double hash) prefix.if you want to know more about temp table then read my article : http://www.c-sharpcorner.com/UploadFile/75a48f/temporary-table-in-sql/

    • 3
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are two type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 2
  • Joe Wilson
    Dec, 2015 12

    Local & Global

    • 2
  • Sudheshwer  Rai
    Sep, 2015 21

    There are two types of Temporary Tables. 1-Local Table As- Create table #tblName () It exist only current window(In SQL Server)/Tab where we declare it. Out of this window/tab it destroy.2-Global Table As- Create table ##tblName() It exist in all window(in SQL Server)/Tab. And it destroy when all connections that have referenced them have closed.

    • 2
  • Ashish Srivastava
    Dec, 2017 21

    There are two types of temporary table. 1.Local Temporary Table: # (hash) prefix 2.Global Temporary Table: ## (double hash) prefix

    • 1
  • Mukesh Kumar
    Sep, 2017 12

    2

    • 1
  • Thiruppathi R
    Jun, 2016 1

    Temp table start with # symbol and that are two type : local and global.

    • 1
  • Keerthi Venkatesan
    Apr, 2016 20

    Types : Local tables and global tables.

    • 1
  • Khan Abrar Ahmed
    Apr, 2016 11

    There is Two type of temporary table 1.Local temporary table 2.Global Temporary table

    • 1
  • bharat aggarwal
    Jan, 2016 6

    Two type of temporary table 1.Local temporary table 2.Global Temporary table

    • 1
  • Sandeep Kumar
    Dec, 2015 27

    There is 2 types of Temporary tables and these are (1) Local Table (2)Global Table

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are two type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are two type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are two type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are tow type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are tow type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are tow type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Aditya Patel
    Dec, 2015 24

    Temporary Tables are tow type 1 .Local Temporary Table for more detals go to this link http://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver 2 .Global Temporary Table for more detals go to this link http://www.mindstick.com/forum/33544/how-to-create-global-temporary-table-in-sqlserver

    • 1
  • Kml Surani
    Dec, 2015 21

    local and global

    • 1
  • Rajesh Singh
    Dec, 2015 5

    Plz refer. http://www.c-sharpcorner.com/UploadFile/97fc7a/local-and-global-temporary-tables-in-sql-server-2008/

    • 1
  • Santosh Kumar
    Nov, 2015 27

    ocal temp tables are only available to the current connection for the user; and they are automatically deleted when the user disconnects from instances. Local temporary table name is stared with hash ("#") sign. CREATE TABLE #LocalTempTable( UserID int, UserName varchar(50), UserAddress varchar(150))Global Temp Table-Global Temporary tables name starts with a double hash ("##"). Once this table has been created by a connection, like a permanent table it is then available to any user by any connection. It can only be deleted once all connections have been closed.CREATE TABLE ##NewGlobalTempTable( UserID int, UserName varchar(50), UserAddress varchar(150))

    • 1
  • Suresh Bharti
    Sep, 2015 25

    There Are Two Type 1-Local and Global

    • 1
  • Pramod Gupta
    Sep, 2015 23

    local and global

    • 1
  • Sujeet Suman
    Sep, 2015 2

    Local & Global

    • 1
  • Rahul Prajapat
    Aug, 2015 28

    There are two types of temporary tables: local and global.

    • 1
  • Pankaj  Kumar Choudhary
    Aug, 2015 26

    There are two types of temporary tables: local and global.

    • 1
  • Arvind Upadhyay
    Aug, 2015 17

    .

    • 1
  • Arvind Upadhyay
    Aug, 2015 17

    There are two types of temporary tables: local and global.

    • 1
  • Munesh Sharma
    Aug, 2015 5

    There are two types of temporary tables: local and global.

    • 1
  • ajeet verma
    Jul, 2015 16

    Two types of temporary Tables : Local and Global Local #tableName Global ##TableName

    • 1
  • Saurabh Vasani
    Jul, 2019 26

    There are 2 types of temporary tables Local temporary table and global temporary table.

    Local temporary tables are available in same query window where you create that table , outside of that window you can not access that table.

    Syntax is very similar to create table just we need to add prefix # with table name like

    Syntax :
    Create table #myTable

    Local table are stored inside TempDB database. when we create Local temporary table sql server will add unique id automatically to that table in the end because there may be possibility to create same table with the same name from the other query window so for to make differentiate sql will add that unique key.

    Scope of this table is local.

    This table will be deleted when we close the query window from where we generate that table.

    Global Temporary Table
    Global temporary table is work same as local temporary table difference is that the name of the Global temporary table is unique.
    Scope of this table is global means everyone can use this table who are not generate this table.

    This table will dropped when all the connected users are disconnected from the sql server instance.

    Syntax : Syntax is little bit different than local temporary table . we just need to add double ## sign prefix of the table name.

    Create table ##myTable

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS