Derived tables vs. temporary tables

  • How are derived tables different from temporary tables?

    Are derived tables what is used in inline table valued functions?

  • Derived table is another name for subquery - a select statement within another query. It's not persisted after the query finishes, it may not even be stored at all

    A temp table is a real table that's stored in the TempDB database, column, indexes, constraints, etc. It persists until dropped or until the procedure that created it completes or the connection that creates it closes.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Search for 'Temporary Tables' here (explanation & examples):

    http://msdn.microsoft.com/en-us/library/ms174979.aspx

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply