Search code examples
sqlsql-view

SQL: Drop Views When Table is Dropped


Is there a standard SQL command that when a table is to be dropped, it drops all the views on it as well?


Solution

  • No, there is no standard way to drop a table and all associated views. I know Postgres has a CASCADE option but that's implementation specific - MySQL accepts CASCADE but does absolutely nothing with it.