Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies®
by Robert D. Schneider, Darril Gibson
III.8.4. Maintaining a View
Things change. People's needs change. And yes, views can change. When you first create a view, it's probably perfect. As people's needs change, though, that view might no longer meet their needs. Often, it takes only a minor change to make it perfect again.
Modifying a view is referred to as modifying the view definition. The view definition is the statement used to create or alter the view, starting with CREATE VIEW or ALTER VIEW. View definitions can be modified with the View Designer or the T-SQL ALTER statement.
To modify a view, you need an existing view. Although AdventureWorks has many views included, you might not want to modify one of them. The following step creates two copies of an existing view that you can then modify in the View Designer and with T-SQL statements.
Launch SQL Server Management Studio (SSMS).
Choose Start
All Programs
Microsoft SQL Server 2008
SQL Server Management Studio.On the Connect to Server screen, click Connect.
Using the SSMS Object Explorer, browse to the Databases | AdventureWorks2008 | Views container. Select the HumanResources.vEmployee view.
Right-click the HumanResources.vEmployee view and choose Script View AsCREATE To ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access