Refreshes the metadata for the specified view. Persistent metadata for a view can become outdated because of changes to the underlying objects upon which the view depends.
sp_refreshview [ @viewname = ] 'viewname'
[@viewname =] 'viewname'
Is the name of the view. viewname, which can be a multipart identifier, is nvarchar, with no default.
Return Code Values
0 (success) or a nonzero number (failure)
Members of the sysadmin fixed server role, the db_owner and db_ddladmin fixed database roles, and the view owner can execute sp_refreshview on a view.
This example refreshes the metadata for the view titleview.
exec sp_refreshview titleview