.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Table Variable Vs Temportary Table in Sql Server.

Posted By: Deco     Posted Date: September 21, 2010    Points:2   Category :Sql Server
Can anyone tell me the difference and in which situation we use Table Variable and Temporary table.

Author: Syed Shakeer Hussain             
Posted Date: September 21, 2010     Points: 5   


# 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.

# 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.

# Table variables are stored within memory but are laid out like a table. Table variables are partially stored on disk and partially stored in memory. It's a common misc

Author: Deco             
Posted Date: September 22, 2010     Points: 5   


Thank you very much for your reply.

i know the concept of Temporary table and Table Variable.

I'm asking about the scenario in which we use these...


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend