Home

Altering a View

   

Introduction

The basic formula to programmatically modify a view is:

ALTER VIEW ViewName
AS
SELECT Statement

Here is an example:

ALTER VIEW dbo.ListOfMen
AS
SELECT dbo.Persons.FirstName, dbo.Persons.LastName
FROM   dbo.Genders INNER JOIN dbo.Persons
ON     dbo.Genders.GenderID = dbo.Persons.GenderID
WHERE  (dbo.Genders.Gender = N'Male');

Home Copyright © 2007-2013 FunctionX, Inc. Home