Add an option to generate DROP statements?

rgribblergribble Posts: 88
edited August 1, 2006 9:26AM in SQL Toolkit Previous Versions
I am using RedGate toolkit to generate creation scripts for all objects in a database, to store in source control. I was previously using SQLDMO to achieve this and there was an option in that (and in Enterprise Manager) to add a DROP statement to the start of the script, so it could be run whether the item exists or not.

For the time being i have had to add my own support for generating the DROP statements, but ultimately it would be great if the toolkit supported an option in the Options enumeration to generate this for me!!
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Venue]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Venue]

CREATE TABLE [dbo].[Venue]
[VenueId] [smallint] NOT NULL,

... etc


  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Ryan,

    Thanks for your post. Lots of customers continue to ask for the if exist...drop to be added as an option. I don't knwo if and/or when we'll ever see this get done.
Sign In or Register to comment.