Hello @Vijay Kumar ,
To modify your index maintenance script to only perform REORGANIZE by removing or replacing any REBUILD logic. If your script uses conditions based on fragmentation, make both medium and high fragmentation levels use REORGANIZE.
For example:
ALTER INDEX [IndexName] ON [Schema].[TableName] REORGANIZE;
If you are using Ola Hallengren’s maintenance script, you can set both parameters to reorganize only:
EXEC dbo.IndexOptimize
@Databases = 'YourDatabase',
@FragmentationMedium = 'INDEX_REORGANIZE',
@FragmentationHigh = 'INDEX_REORGANIZE';
This will ensure all indexes are reorganized and never rebuilt.
For more information, you can refer to this article here: https://free.blessedness.top/en-us/sql/relational-databases/indexes/reorganize-and-rebuild-indexes?view=sql-server-ver17
If you need more precise assistance, feel free to share more context of your script so I can assist you better.