How to set scripting defaults in SQL Server Management Studio

In SQL Server Management Studio when you use the DB (right click) -> Tasks -> Generate Scripts option to export a DBs schema you’ll see that by default SSMS does not script either indexes or triggers (among other items).

For a long time I found this quite annoying as every single time I wanted to export a schema I had to go into the advanced settings and explicitly tell SSMS to export indexes and sometimes triggers depending if they were used or not.

Thankfully I have since found out that it is possible to set defaults for all scripting options

Example 1 below (click for a larger view in a new window) shows the default advanced scripting options with neither indexes or triggers set to be scripted.

Example 2 below shows how we can set new defaults for these and other scripting options.

How to set scripting defaults in SQL Server Management Studio

After setting these defaults I can now bypass the advanced settings screen on almost all occasions which is a nice little time saver.

Leave a Reply

Your email address will not be published. Required fields are marked *