(MSSQL) Sp_refreshview refresh view failure and Update table field failed problem resolution

Source: Internet
Author: User
Tags mssql

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.