When I drop a view or stored procedure, is cache clear automatically ??

  • When I drop a view or stored procedure, is cache clear automatically ??

  • I don't think either cache is cleared. The procedure cache, because that will likely be cleared as space is needed. Same for execution plans.

    For the data cache, that's data, not a view or a proc. It is also cleared as new space is needed and that data is stale.

  • Thanks for your reply.

    We have snashot replication we are dropping all tables,views,stored procedures,functions,indexes,foreign keys etc and recreating them. Will they impact in any way to cache and execution plan.

  • The entire of cache won't be cleared (that would be a bad thing). Just the plan of the object dropped will be marked as invalid and discarded.

    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
  • Did you mean there is no impact on cache but execution plan will be recreated.

Viewing 5 posts - 1 through 4 (of 4 total)

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