Generate CREATE INDEX statements in SQL Server

后端 未结 4 518
滥情空心
滥情空心 2020-12-20 18:41

Does anyone have a script to list of CREATE INDEX statements for all existing indexes in a SQL Server database?

This thread List of all index & index columns in

4条回答
  •  甜味超标
    2020-12-20 19:32

    You can do it on a table by table basis by using the "Object Explorer" window

    Go to the Indexes folder in Management studio, highlight the folder then open the Object Explorer pane

    You can then "shift Select" all of the indexes on that table, if you right click to script "CREATE TO" it will create a script with all the relevant indexes for you.

提交回复
热议问题