I have tried SQL Server 2008 Management Studio and other third party tools to script all database objects (views, SPs & tables) and I can’t get anything to generate a one file script which has a drop statement preceded with an ‘If exists..’ statement for every object.
I need the ‘if exists’ statement so I don’t get any errors if an object doesn’t exist. The tool doesn’t have to be for sql server 2008.
SQL 2008 Management Studio can do this. Right click on the database name and select Tasks->Generate Scripts…check the box that says ‘All Database Objects’ and then on the next screen set Include If NOT EXISTS to True (this will also do the If Exists…though it’s not apparent) and Script Drop to True. I think this will work for you.