Changing a View

In Interactive SQL, you can use an ALTER VIEW statement to change a view definition with a modified version.

The emp_dept view lists all employees by department. You can use the following command to change the view to display only those employees in the Sales department:

ALTER VIEW emp_dept AS  
  SELECT Departments.DepartmentID,
   Departments.DepartmentName, Employees.EmployeeID,
   Employees.GivenName,Employees.Surname,
   Employees.Street,Employees.City,
   Employees.State,Employees.Phone
FROM Departments, Employees
WHERE Departments.DepartmentID = 200
ORDER BY Employees.State

ALTER VIEW replaces the existing SELECT statement in the view with the SELECT you defined in the ALTER VIEW command. Existing permissions on the view are maintained.

To change a view in Sybase Central, right-click the View, and choose Edit in New Window.