I am writing an install script that installs all tables, stored procedures, views, full text indexs, users ect.
It all works fine if the user has all the correct permissions and the script runs from start to finish. However if the script dies somewhere midway through then it cannot just be run again.
To accomplish this I want to basically return the database to a "brand new" state where it has nothing.
I realize how to drop each table/sp/view.. on their own but I am looking for a more general way to reset the database.
I also need to be able to delete Fulltext Catalogs and users.
Thanks for any help.
Running SQL Server 2005