The rotational properties of the transfermium nuclei are investigated in the full deformation space by implementing a shell-model-like approach in the cranking covariant density functional theory on a three-dimensional lattice, where the pairing correlations, deformations, and moments of inertia are treated in a microscopic and self-consistent way. The kinematic and dynamic moments of inertia of the rotational bands observed in the transfermium nuclei ^{252}No, ^{254}No, ^{254}Rf, and ^{256}Rf are well reproduced without any adjustable parameters using a well-determined universal density functional. It is found for the first time that the emergence of the octupole deformation should be responsible for the significantly different rotational behavior observed in ^{252}No and ^{254}No. The present results provide a microscopic solution to the long-standing puzzle on the rotational behavior in No isotopes, and highlight the risk of investigating only the hexacontetrapole (β_{60}) deformation effects in rotating transfermium nuclei without considering the octupole deformation.