Technology of SQL Server database (51)
Tuesday, March 03, 2009 by rain
8.3.1 is examined with Enterprise Manager, modification index
In the database that the choice in Enterprise Manager should examine,It is next in task board choice " Tables%26amp;Indexes " page casing,Can be in task board the index information that all users that show this database express,Place of the 8-11 that be like a graph is shown.
The detailed information that should be examined and revises index,Right key is clicked on the watch that need should examine in place,Choose from inside quick menu " All Tasks " child in menu " Manage Indexes " option,The index management dialog box that if place of graph 8-9 is shown,will appear.The index that the choice should be examined or revises,Click " Edit " pushbutton,The modification index dialog box that if place of graph 8-12 is shown,appears.
In the modification index dialog box that shows in place of graph 8-12,The much that can revise index is installed,Still can revise script of its SQL directly,Need to press only " Edit SQL... " pushbutton,The SQL script that if place of graph 8-13 is shown,can show edits casing.Can amid editor, test and the SQL script of moving index.
But the name that index cannot revise in the dialog box of editor of SQL script of the index in graph 8-13,The index name of program kind revises need to use Sp_rename of systematic memory process.Should be in business management implement in the name of modification index,Change its place to belong to the other information such as file group,In needing the attribute dialog box in the watch, undertake,Place of the 8-14 that be like a graph is shown.Should notice,The attribute dialog box that place of graph 8-14 shows is the modification list that shows from place of graph 7-4 call in structural dialog box,is not to connect those who cross quick menu directly " attribute " dish individual event is called.
8.3.2 examines index with memory process Sp_helpindex
The information of all index that Sp_helpindex stores the process can return a watch.Its grammar is as follows:Sp_helpindex [@objname =] 'name'
Among them [the name that clause of @objname =] 'name' designates the watch in current database.
Exemple 8-4:The index that examines watch Orders.Exec Sp_helpindex Orders
Moving result is as follows
8.3.3:Change index name with memory process Sp_rename
Exemple 8-5 changes Orders to express name of medium index Orders_quan to be Orders_quantity.Exec Sp_rename 'orders. [Orders_quan]' , 'orders_quantity' , 'index'
Moving result is as follows:
------------------------------------------------------------------------------------------------------------------------
Caution: Changing Any Part Of An Object Name Could Break Scripts And Stored Procedures.
The Index Was Renamed To 'orders_quantity' .