Barnsley boss Keith Hill says he has learned a lot from the departure of Ricardo Vaz Te to West Ham.
The 25-year-old Portuguese striker moved to the Hammers for an undisclosed fee in January having joined the Tykes on a one-year deal last summer.
"It's important when we have good players at the club that we can retain them," he told BBC Radio Sheffield.
"In hindsight we would have kept Ricardo, but I don't know what frame of mind he'd have been in."
He added: "It was difficult because if we'd sold him and gone down then we would have lost a lot more money than we'd have made on the transfer.
"We need to look at getting our better players on longer term contracts so that when we sell them it's because it's right for us."
The Oakwell side were 14th with 36 points from 27 games when they sold Vaz Te, who had 10 goals from 22 league appearances for the Tykes, in January.
Since his departure they have picked up just 11 points from their following 16 matches and only secured their Championship status on Tuesday thanks to Coventry's defeat by Millwall.
For the promotion and relegation news as it happens in the Championship this Saturday - follow our new exclusive text commentary service Football League Live. It has fixtures, results, as-it-happens tables and regular reports from across the Football League. Saturday, 1400 BST, bbc.co.uk/sport.