O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dropping a View with DROP VIEW

Use the DROP VIEW statement to destroy a view. As a view is physically independent of its underlying table(s), you can drop the view at any time without affecting the table(s). All SQL programs, applications, and other views that reference the dropped view will break, however.

To drop a view:

  • Type:
    DROP VIEW view;
    
    view is the name of the view to drop (Listing 12.17).
Listing 12.17. Drop the view ny_authors.
						DROP VIEW ny_authors;

✓ Tips

  • Dropping a table doesn’t drop the views that reference that table, so you must drop the views with DROP VIEW explicitly; see “Dropping a Table with DROP TABLE” in Chapter 10.

  • SQL has no ALTER VIEW statement. If the underlying table(s) or view(s) changed since a view was created, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required