When I run “Script as” it isn’t (or is) … How do I fix it?

1

September 3, 2013 by Kenneth Fisher

When I run “Script (say table) as” it isn’t (or is) (say generating scripts for indexes). How do I fix it? This is a common enough question with a fairly simple solution. In the Options screen there are dozens of options for the scripting function of Object Explorer. These options include scripting primary keys, indexes, full-text indexes, file groups, including collation, permissions, even a choice to script for Standalone SQL Server or SQL Azure.

Honestly if you have never spent a few minutes (even an hour or more) exploring the options available for SSMS you should. It will be well worth your time. To topic however, here is the Options screen with the Scripting options selected.

SSMSOptions

Spend some time reviewing the list and make sure that the settings you are interested in are turned on and the ones you don’t want are turned off. For example “Script indexes” under “Tables and Views” was set to False when I did my install. I absolutely wanted indexes scripted so I set it to true. I’m not big on all of the “USE” statements that normally get scripted so I turned the “Script USE ” option to off.

One thought on “When I run “Script as” it isn’t (or is) … How do I fix it?

  1. […] Run that on a 2005 instance, I dare you :). Contained databases weren’t introduced until SQL 2012, so this script won’t run on 2008 or 2008 R2 databases either. So what’s the solution? Change one of the scripting settings! […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 3,755 other subscribers

Follow me on Twitter

ToadWorld Pro of the Month November 2013
%d bloggers like this: