12

Recently I realized by default, scripting the database does not including indexes, and I have to change the option every time.

Could anyone please explain the reason? Is there any insight about this default behavior, or is it just because Microsoft likes to do so?

karel
  • 324
  • 1
  • 8
Luke Vo
  • 223
  • 2
  • 6

1 Answers1

13

You don't have to change the option every time. If you change the selection in Tools > Options > Object Explorer > Scripting, it should persist.

As for why not scripting indexes is the default, I have no idea. Not a great question for your peers; if you really want the background, hit up someone on the SSMS team and buy them a beer - maybe they'll be able to share it. You could also consider submitting a suggestion on the SQL Server feedback forum (if one doesn't already exist), and they will possibly tell you why it's the default and/or why they won't be changing it.

Aaron Bertrand
  • 181,950
  • 28
  • 405
  • 624