DB Autoshrink option may introduce high fragmentation

Issue

We have seeing some strange behavior when rebuilding indexes.

· Total Fragmentation prior to rebuild is 99%.

· You rebuild the index. (using both the alter index and the dbcc dbreindex)

· Fragmentation is at 0%

· You recheck fragmentation about a minute later.

· Fragmentation is at 99% again.

· You have verified that there are no DML's being done on that table.

Analysis

We noticed that the database has “Auto Shrink” enabled.

Status

After we disabled the auto shrink, it’s working fine.