A Dancing Sword can be launched by its controller to make melee attacks at range:
You can use a bonus action to toss this magic sword into the air and speak the command word. When you do so, the sword begins to hover, flies up to 30 feet, and attacks one creature of your choice within 5 feet of it. The sword uses your attack roll and ability score modifier to damage rolls.
We know the sword uses the controller's stats to hit and do damage. What's not clear is:
Is this attack considered made by the character or by the sword itself?
The answer to that question has consequences, since several characters' abilities use the "when you make an attack" trigger.
For example, a 11th level paladin can use Improved Divine Smite when he attacks (emphasis mine):
Whenever you hit a creature with a melee weapon, the creature takes an extra 1d8 radiant damage. If you also use your Divine Smite with an attack, you add this damage to the extra damage of your Divine Smite.
If it's the sword that hits, no Divine Smite - improved or not - can be delivered that way.
Another example (amongst others) would be the Rogue's Sneak Attack ability, assuming the Dancing Sword is a finesse weapon and the other criteria are met.
A quote from a rulebook, the game designers, or an official Q&A would be welcomed.
The topic was partially discussed here - Can a paladin use his Divine Smite/Improved Divine Smite when using the Tentacle Rod? - but I've found the chosen answer inconclusive. Moreover, the Dancing Sword, unlike the Tentacle Rod, doesn't have to be held to deliver an attack.