Wednesday, March 7, 2012

Drop All Views

Is there a command or a way to drop all views of a database with one command or must one do a drop command for each view?

You must do a separate DROP for each VIEW.

However, you can do it in a loop where you don't have to know the VIEW name in advance.

|||

I have a procedure to do this in this file: http://drsql.org/Documents/utility.drop_objects_procs.zip

It is called: utility.codedObjects$remove and you pass it a value of 'VIEW' for the @.object_type_desc parameter

I have had a few problems downloading it in IE7, but none with Firefox...

Louis

|||

one simple method , select 'Drop view '+Name from sysobjects. You can create a sp as input parameter object type and you can make it more dynamic.

run this select statement in QA and copy paste the result to QA and run

Madhu

|||

Arnie,

Thanks for confirming what I thought was true.

Mary

|||

Louis,

Thanks for all the valuable information.

Mary

|||

Madhu,

Thanks for the information it is a great help.

Mary

No comments:

Post a Comment