Sql – Performance difference between Views and Temporary tables

sqlsql-server-2008temp-tablesview

Is there any major difference in the performance of the Views and Temporary tables. I have situation like to migrate data from one database to the other. I have to extract the source data from views to the tables in the destination db.

As there are no unique field in it I tried extracting the data from views into Temporary table and the process it to push the data into destination table. I don't find any major performance changes with respect to time.

Best Answer

The main difference between temporary tables and views is that temporary tables are just the tables in tempdb, but views are just stored queries for existing data in existing tables. So, there is no need to populate the view, because the data is already here. But temporary table needs to be populated first, and population is the main preformance-concerned issue.