Skip navigation.

Keyboard Shortcuts in Office 2007All recent postsWhat Happened to Good, Clean, Simple Hardware?

SQL Server 2K5: Either Drop or Create Annoyance

I’m really loving SQL Server 2005 with its new Management Studio and other goodies, but there’s one feature that drives me nuts. In SQL Server 2000 you could script both the deletion and creation of a stored procedure, table or what have you. In SQL 2K5 it’s either one or the other. That’s annoying!

For example, to script stored procs, you right-click on a database and go to Tasks | Generate Scripts…Step through the wizard until you get to the Script Options screen (shown below).

Choose Script Options screenshot

In the generated T-SQL you get either DROP or CREATE statements. In SQL Server 2000 you could do both! This makes me run the wizard twice now. I don’t know if I’m missing something very obvious, but having to do this every time drives me nuts.

On the upside, when you right-click on a table, you can get a CRUD operation template created for you (see screen shot below). Now, that is quite useful!

Have CRUD operations scripted for you

Comments

Comment permalink 1 Bill Graziano |
You're not missing anything obvious. It's one of the most request fixes for SQL Server:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124561

I was annoyed enough that I wrote a little utility to script DROPs and CREATEs together.

http://weblogs.sqlteam.com/billg/archive/2006/06/13/10208.aspx

-Bill
Comment permalink 2 Milan Negovan |
Many thanks, Bill! Btw, love your tag line, "Building tomorrow's legacy systems today. One crisis at a time."
Comment permalink 3 Dave |
it's strange how the Script Wizard shows the description at the bottom saying you can script "DROP statements followed by CREATE statements"! Maybe they forgot to add the option?!`

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

TrackBacks

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):