views:

15

answers:

1

Using the Generate Scripts wizard in SQL Server Management Studio 2005 (right click a database -> Tasks -> Generate Scripts...). There is an option for Script Behaviour. The description for the option is as follows:

Script Behaviour

Generate the script as DROP statements, CREATE statements, or DROP statements followed by CREATE statements.

However, there are only two options to select from:

  • Generate CREATE statements only.
  • Generate DROP statements only.

Where is the option to DROP and CREATE? Is there a way to get this behaviour, or have they simply left it out?

+3  A: 

In SQL Management Studio (2005 SP3), when i right click on a database -> Tasks -> Generate Scripts, after I select my database and choose Next, the wizard then presents me with a number of script options, with most of them being True/False settings.

To achieve DROP and CREATE I expect you would need to set both the properties below to true.

  • Script Drop
  • Script Create

By default i think Script Create is set to TRUE and Script Drop is set to FALSE.

kevchadders
Unfortunately, these options are not available to me. Perhaps I have a different version. I'll try installing SQL Server 2005 Service Pack 3 and see if it has an update for management studio.
Evil Pigeon
My Version is 9.00.4035.00 which does indicate its Server Pack 3 (Source: http://support.microsoft.com/kb/321185)
kevchadders
Thanks. Service Pack 3 has addressed this issue.
Evil Pigeon