If this sample was helpful to you, vote it up. If you have an improved version, or a closely related sample, post it as an answer. If you have a question or complaint, post it as a comment (or an answer, if you have a lot to say :) Description: Usage:
To drop all views in a database:
Code:
asked 23 Feb '10, 22:02 Calvin Allen Volker Barth |
I have used a similar proc in the past, but fortunately SA 11.0.1 introduced the following handy syntax:
(As it does for other database objects like triggers etc.) But of course it does not allow to drop all views:) answered 24 Feb '10, 08:22 Volker Barth |
Adding the owner name as a 2nd param (with default "DBA"?) would be nice. E.g. our schemata are usually owned by "dbo" - primarily for historical purposes like compatibility with MS SQL.