Views exist in memory or on disk?

  • When a user creates a view from multiple tables, the data from it gets stored somewhere. Is it in memory or on Disk? Just curious.

  • newdba2017 - Monday, August 14, 2017 2:14 PM

    When a user creates a view from multiple tables, the data from it gets stored somewhere. Is it in memory or on Disk? Just curious.

    The data is already stored in the underlying tables and is not stored again.
    A (non-persisted) view is really just a SELECT query.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • newdba2017 - Monday, August 14, 2017 2:14 PM

    When a user creates a view from multiple tables, the data from it gets stored somewhere.

    Nope, the data does not get stored anywhere. The view is stored solely as the statement that defines it. When you run a query against a view, during the parsing process the view's name is replaced by its definition and the resulting query is what's run.

    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

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

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