A view created, certain users have direct access to the database using the same web application. If the base table is changed (data) will the view automatically reflect the changes/insert in data, or will it need to be created again and again? Vs08 sql-server-2005 c#
views:
48answers:
3Views recalculate themselves automatically. When this happens depends on the specific engine in use (read: I have no clue when for SQL Server 2005).
Views are like windows, they just let you see what's in the table. They don't contain a copy of the table or anything like that.
If you change the definition of the table, like add or remove a column, you should rebuild the view. But if you are just doing insert/update/delete, then everything will just work.
In effect, a view is a just a pre-written select statement.
Every time you make a call to the database for a particular view, the select statement runs and the current dataset in the base table(s) is returned.
You won't see live changes in an application front-end if someone else makes a change to the data table but you will see any changes as soon as you make a new request for the view.