December 31, 2011 at 1:11 am
I knew that when we create a Clustered index on a VIEW. it would be stored in the database as table is.
My Query is:
what happened when changes are done with the underlying table? will the physical view get updated from the forthcoming calls of that VIEW or what?
appreciating your help.
December 31, 2011 at 1:18 am
Per BOL:
As modifications are made to the data in the base tables, the data modifications are reflected in the data stored in the indexed view.
For More: http://msdn.microsoft.com/en-us/library/ms187864.aspx
December 31, 2011 at 6:16 am
DBA Rafi (12/31/2011)
I knew that when we create a Clustered index on a VIEW. it would be stored in the database as table is.My Query is:
what happened when changes are done with the underlying table? will the physical view get updated from the forthcoming calls of that VIEW or what?
appreciating your help.
What kind of changes do you mean?
DATA changes would appear immediately in the view. you could do it the other way, and update the view, and the changes would appear in the table.
DDL changes, like adding columns would NOT be seen in the view. for example, if your view had SELECT * in it, it actually gets compiled as SELECT col1,col2,ColumnList....so new columns will not be seen unless you do sp_refreshview [viewname]
if you drop column a regular view was using (which in this case...a clustered SCHEMABOUND view will not allow that to happen)
then the view will be broken/invalid, and will need to be tweaked and recompiled/( ALTER VIEW)
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply