Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

I just need to rebuild one table and one index

Rebuild  index on one table and one index.
I see alot of scripts to rebuild ALL indexes,

I just need to rebuild one table and one index ?

Metrics =  Database name
metrics_crs =  table name
STATUS =  index name

Thanks
fordraiders
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Above one by Scott should be sufficient if you are quick starter..
If your metrics_crs table is huge and if your index size is also huge, then you would need to look into few more options listed below depending upon your SQL Server version, table whether it is compressed or not..
1. REBUILD WITH ONLINE = ON
2. ONLINE = ON
3. SORT_IN_TEMPDB = ON
4. PARTITION = partition_number

Complete info about the above parameters here..
https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-index-transact-sql?view=sql-server-ver15
Avatar of Fordraiders

ASKER

Thanks