We have a View (call it X) that is the base view called by 2 other views(call them Y and Z).
Today we made a change to view X, after that view Y and Z started bringing back data that was incorrect. When we were in Management Studio and ran Select * from Y
(which is exactly how the view is called in in code) it would get back data that was incorrect. However, when we ran the actual SQL that the view contained it was fine. We tried a number of things until a colleague suggested adding a space to view X and Z and then running Alter, which worked. Everything returned to normal and ran fine.
My question is: Does MSSQL cache its views? and if so how do you force them not to OR force them to re-compile?
Also, any additional reading about this would be helpful.