Avatar of Fordraiders
Fordraiders
Flag 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
DatabasesMicrosoft SQL ServerSQL

Avatar of undefined
Last Comment
Fordraiders

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott Pletcher

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Raja Jegan R

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
Fordraiders

ASKER
Thanks
Your help has saved me hundreds of hours of internet surfing.
fblack61