Hi friends,
I want to know that what is the temporary table in sqlerver? Can we make any temporary table it's own give the explanation also?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 11, 2012, 11:04 PM
SQL Server provides the concept of temporary table which can be created at runtime and can support the all kinds of operations that one normal table can do. But, the life of these table is depend on table scope. These tables are created inside
tempdbdatabase.Example:
Local Temporary Table
CREATE TABLE #TempTable(ID int,
Name varchar(50),
Address varchar(150))
insert into #TempTable values ( 1, 'Jignesh','India');
Select * from #TempTable;
Drop table #TempTable
Global Temporary Table
CREATE TABLE ##TempTable(
ID int,
Name varchar(50),
Address varchar(150))
This is because the scope of Local Temporary table is only bounded with the current connection of current user.
Global temporary tables are visible to all SQL Server connections. When you create one of these, all the users can see it.
hope this help.
Mukesh KumarPosted Jan 11, 2012, 12:17 PM
Check below link:
http://www.codeproject.com/KB/database/TempTable.aspx
Satyapriya NayakPosted Jan 11, 2012, 11:12 AM
Please refer the below link
http://www.simple-talk.com/sql/t-sql-programming/temporary-tables-in-sql-server/
http://vishalnayan.wordpress.com/2011/04/14/what-are-temporary-tables-in-sql-server/
Thanks