>>The real problem is not with dropping in a loop but you can't simply drop a table that has objects depend on it. First you need to drop constraints and such and do dropping in an order, be carefull.
>
>This is a brand new database. It doesn't have any constraint. Also, as I mentioned in the first reply once you provided that code, the error is that it cannot execute it. So, it's either I didn't understand the proper syntax on how to use it or either it's not supported on my version. I have SQL Server 2005.
Oh then (I read it can't find such a procedure-it's a system sp and exists with all databases in SQL2005). Try in Management studio:
use myDatabaseName
go
sp_MSForEachTable 'select * from ? where 1=2'
In your case it would be just as Borislav showed:
sp_MSForEachTable 'Drop Table ?'
? is a placeholder for tablename that is fed into procedure foreach call.
Cetin