locked
Difference between view and temp table in sql server. RRS feed

  • Question

  • User221424154 posted

    What is the difference between view ans temp table in sql server?

    Monday, November 4, 2019 5:38 AM

Answers

  • User-719153870 posted

    Hi Manishamani,

    As far as i know, temporary tables and views can be totally different things in SQL Server.

    A temporary table is just like a normal table in you database, but temporary table only exist in session, once you close the session, the temporary table will also disappear.

    A view is usually the result of a query, it can be stored in your database, you can see it in your SSMS in the Views folder. They are usually created to store a result of a complex query from your datasource (and its data can be affected by the datasource) so that you can do more queries on the result based on the simple view.

    For more information, you can refer to Views and SQL - Temporary Tables.

    Hope the explanation is clear.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 4, 2019 6:34 AM