SQL: Drop Views When Table is Dropped

289 views Asked by At

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

2

There are 2 answers

0
Sean McSomething On BEST ANSWER

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.

2
Ross Bush On

There is not a standardized command across all rdms that will drop a table and it's bounded view(s) in one operation.