|This article is about an older version of DF.
With vampires, solitary confinement can be limited to an office. Vampires need no sleep, food, or drink, but they wil get unhappy thoughts from old clothes being naked. If you do not wish to provide new clothes regularly (by dumping them through a pit from above), consider placing high value items in the room to offset these bad thoughts - unless you don't mind the vampire going insane.
Why keep him alive? So he can do something useful. A mildly sensible option is making them the fortress's bookkeeper (but really, any average dwarf can do that job on the side) setting accuracy to maximum (who doesn't?). At least make him manager too. The vampire can also act as a dedicated lever-puller, so that levers are pulled quickly when you give the order. Even with the vampire's slowdown from alcohol withdrawal, the close distance to the levers will improve response time.
Locked-in vampires can also serve as a Plan B in case the rest of the fortress is slaughtered, as they will be safe behind walls; since vampires are effectively super-soldiers, you can provide them with arms and armor beforehand and then let them out (this requires that you provide the vampire with some means of removing obstructions -- give the vampire a pick, or put a lever to open his cell inside the cell, or just have one of the walls be a construction and have the vampire remove it), or just let them wait in their prison until migrants arrive. You will have to provide new clothes eventually, this can be done with a drop-chute from above.
With regards to regular, unhappy dwarves, solitary confinement chambers can take the form of bedrooms behind levered floodgates into which the dwarf will be stationed. The floodgate should be down normally, to avoid the bed being slept in by stragglers. The dwarf inside will not be able to do any useful work, but the rest of your populace will be safe from any tantrums they throw that may otherwise result in deadly tantrum spirals.
A small stockpile of food and booze is required for this to work, or else the dwarf will starve. Unless that's the point; dwarves currently do not have any unhappy thoughts associated with others going permanently missing, and if the dwarf in question is a real menace to the fort, they might be better off dead; just never recover the body, and build them a slab instead of a coffin. A high-quality chamber will do wonders for unhappy dwarves, however, as they will have nothing to do but stare at your ☼Platinum Statue☼. An overly lavish confinement chamber (nice bedroom, nice dining arrangements, a personal statuary) might cure any dwarf.