HiveBrain v1.2.0
Get Started
← Back to all entries
gotchasqlModerate

Why does SQL Server Mangement Studio not script Indexes by default?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
scriptmangementwhysqlindexesdefaultdoesstudioservernot

Problem

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 just because Microsoft likes to do so?

Solution

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.

Context

StackExchange Database Administrators Q#141767, answer score: 12

Revisions (0)

No revisions yet.