For example:
Create view View_AutoUpdate as
(
select a.*,b.[name] from User as a,Company as b where a.CompanyID=b.CompanyID
)
Done,but when i do it follow:
Alter table User add UserAddress nvarchar(50) null
Done.
finally,i type "select * from View_AutoUpdate ",the list column is not right.
thanks

How to automatic update view when table's structure has changed
AtomZ .be
XBTester
After you alter the table,
exec sp_refreshview 'view_name'.
This should update the view definition to include the newly added table column.
HTH
Bart Butell
roboky
Andre.Ziegler
Sergey D
Hi,
You can do this by implementing a DDL Trigger on the User Table. This trigger will then recreate your view.
Info on DDL Triggers: http://msdn2.microsoft.com/en-us/library/ms175941.aspx
Greetz,
Geert
Geert Verhoeven
Consultant @ Ausy Belgium
My Personal Blog