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.
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.