Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL 2012 Management Studio - "Script Table as"

In SQL 2008 Management Studio, when you right click on a table in object explorer and say "Script Table as" - "Drop to " etc, the generated script used to have an IF EXISTS check before the DROP statement.

I appears that SQL 2012 Management Studio no longer has this. I did a perfunctory online search on this, as well as looked at the "Options" menu and couldn't find any thing about this feature removal.

Is it possible to get this back somehow?

like image 816
EkoostikMartin Avatar asked Aug 28 '26 18:08

EkoostikMartin


1 Answers

It's optional now, and turned off by default.

Here's how to turn it on again: In Mgmt Studio 2012, you can find the option under Tools -> Options; select SQL Server Object Explorer -> Scripting in the left pane; set Check for object existence in the right pane to True.

like image 163
SWalters Avatar answered Aug 31 '26 04:08

SWalters



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!