Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
harishprasadp
Starting Member
2 Posts |
Posted - 2010-03-16 : 14:36:16
|
| Hi, When we create a view and then later at some point of time we call that view, will the select query within the view be executed every time or it stores the data when it is executed for the first time and then from the second time onwards it gives the result form cache [or some form of saving the result set]?My 2nd question is if the view returns from the cache, how does the changes in the tables reflect in the view? How come the view gets to know whether the tables has been modified or not??I am referring to MS SQL Server 2005.Thanks and Regards,Harish Prasdad Popuri |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-03-17 : 05:33:45
|
| " will the select query within the view be executed every time or it stores the data when it is executed for the first time"The VIEW is executed every time, there is no data "stored" for the VIEW.This is slightly blurred if you have an INDEX on the View ... but SQL takes care of that, behind the scenes, as Tara said - so you don't have to "Refresh" the view, or anything like that. |
 |
|
|
harishprasadp
Starting Member
2 Posts |
Posted - 2010-03-17 : 05:59:58
|
| Thank you Kristen and Tara ..Thanks and Regards,Harish Prasdad Popuri |
 |
|
|
|
|
|