Running SQL Server Standard (64-bit) and setting up some new maintenance jobs for various tasks, one of them being index optimization. My agent job shows as successful but when I check the fragmentation levels the next day after the job runs, my index fragmentation levels are still the same, most being 80% or higher fragmented. I've also tried running a rebuild on them via t-sql and I get zero errors but still the index fragmentation levels are high. Any idea what could be causing that or am I just missing something stupid? Note, I believe because I am running standard and not enterprise, I cannot rebuild online, so not sure if offline makes a difference. Really it shouldn't matter, it's just how sql locks the indexes and tables while rebuilding if I recall...But I have been wrong before!
How big are the indexes getting rebuilt. If they are less than one extent in size (8 pages) you won't see any defragmentation at all and may even see fragmentation increase. If it's less than 3-4 extents, you may still not see any defragmentation. The standard recommendation is to only defrag on indexes greater than 1000 pages. I'd probably take that down to 100 pages in some cases, but not below that.