Click here to Skip to main content
15,911,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
HI All,
Can me suggest how much types of temporary tables in MS SQL Server.

Thanks in advance!
Posted

 
Share this answer
 
 
Share this answer
 
There are two types of temporary tables in TSQL

1.Local temporary tables are temporary tables that are available only to the session that created them. These tables are automatically destroyed at the termination of the procedure or session that created them.
2. Global temporary tables are temporary tables that are available to all sessions and all users. They are dropped automatically when the last session using the temporary table has completed. Both local temporary tables and global temporary tables are physical tables created within the tempdb database.


For more Reffer:http://www.sqlservercentral.com/articles/T-SQL/temptablesinsqlserver/1279/
 
Share this answer
 
There are two type of temporary table in sql server.
Local Temporary Table.
and Global Temporary Table.

You can declare local table variable as


Declare @tempTbl Table(id int, name varchar(100))

declare #tbl table(a int)

&
Global table variable as

declare ##tbl table(a int)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900