In a recent work encounter a task, you need to bulk change a field scattered in many table, while refreshing the related view, but in the execution of the script, the following problems are found
Update field issues
News5074Level -State1The1Row Object'view_rosterstudent'dependent on the column'SName'. Message4922Level -State9The1row because one or more objects access this column,ALTER TABLE ALTER COLUMNSName failed.
Refresh View Issues
15165 - 1 - 'view_rosterstudent', or you do not have the required permissions.
After finding the information on the Internet, finally found the same problem in stack overflow, found the answer in the highest praise answer, because this view schema is bound to this table, resulting in the above problems, specific details can be Baidu search schema binding.
However, because this view creates an index, and the schema binding is necessary for indexing, I have abandoned the change here, and for the time being, there is no validation to recreate the view that does not have schema bindings to solve the above problems, interested or eligible friends can try, can reply to this post.
Note: Another reason why the view could not be refreshed might be a bug in MSSQL2008, which can be referred to in this article.
(MSSQL) Sp_refreshview refresh view failure and Update table field failed problem resolution