65.9K
CodeProject is changing. Read more.
Home

How to empty SQL Server 2005 database using cursor & sys.objects (Deleting All Tables, stored procedures, views & UDF’s)

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Feb 25, 2010

CPOL
viewsIcon

6347

1) You cann't drop any object in schemas other than dbo, so you MUST use sys.schemas system view properly.2) You cann't drop tables even in dbo schema if they are referenced by other ones, not dropped so far. Drop all FKs before tables.dva

1) You cann't drop any object in schemas other than dbo, so you MUST use sys.schemas system view properly. 2) You cann't drop tables even in dbo schema if they are referenced by other ones, not dropped so far. Drop all FKs before tables. dva