When I change a table definition it often invalidates any views on that table. How can I fix this without re-creating the view?

Neil Pike

November 28, 1999

1 Min Read
ITPro Today logo

A. Just like sp_recompile works for stored-procedures there is a way (with 7.0 and above anyway) to do this for views :-

sp_refreshview

It is trivial to write a cursor round sysobjects and then run this automatically via EXEC (..) to refresh all views in a database.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like