Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




What is the difference between temporary table and temporary variable

1.    Temporary Tables
Temporary tables are created in tempdb.
Create Table #Test (Id int, Name varchar(20))
If you need to create indexes on it then you must use a temporary table.
2.    Table Variable
These are similar to temporary tables except with more flexibility.
Declare @Test Table (Id int, Name varchar(20))
3.    Global Temporary Tables
Global temporary tables are visible to all SQL Server connections. When you create one of these, all the users can see it.
Create Table ##Test (Id int, Name varchar(20))

Share this article   |    Print    |    Article read by 2170 times
Author:
Guest
Guest user is that user who have done some activity on website without login. Activity contains commenting on any article, uploading an image on website etc.
Related Articles:
Related Interview Questions: