Data centers can support the energy transition by recovering their waste heat for their own heating uses or supplying it into district heating networks. However, despite the benefits and technological maturity, few such systems exist today, suggesting conditions undermining their practical implementation. This study evaluates, using the Danish context, how heat sale revenues from district heating affect the feasibility of waste-heat recovery for three different-sized data centers under selected conditions. The data center is modelled as a system comprising free-cooling, chillers, and heat pumps. Its operation is optimized to minimize cooling costs, including heat sales, considering techno-economic parameters, environmental conditions, the availability of district heating to accept the heat, and heat sale price. The results suggest that waste-heat recovery requires highly favorable conditions to be viable, including priority access to the district heating system, with up to 13% cost savings at the highest heat prices allowed by current regulation.