T-SQL: Refresh View After a Change in the Design of an Underlying Object

Very often we make changes to the design of an underlying objects, used by views. After we do this, we need to refresh the views to apply the changes.

In this example we will:
1. Create View
2. Change the design of an underlying object
3. Refresh all the views that depend on the object, which design is changed

Create database

Create underlying tables

Create Underlying Tables

Create views

Create Views

ALTER Customers

ALTER Customers

Test the views

Test the Views Before

Recreate all the views that depend on table Customers

Cursor List

Test the views

Test Views After

Delete database


Leave a comment

Your email address will not be published. Required fields are marked *