TODO:
Have you ever wanted to script all indexes for a particular table in SQL Server?
SOLUTION:
The solution is simple and requires no code.
- Open SQL Server Management Studio
- Click "Tools"
- Click "Options"
- Expand "SQL Server Object Explorer"
- Click "Scripting"
- Scroll to "Table And View Options"
- Click "Script Indexes" and set it to "True"
- Now right click on your Table in Object Explorer
- Now Click "Script Table As" -> "CREATE TO" => "New Query Editor Window"
- All indexes for the table will be in the script generated.
NOTES:
There are no notes on this topic.