Time consuming, but garanteed method:
Assign each dwarf a unique room, and lock them in. If the get thirsty, hungry, or sleepy let them out.
A vampire will obey a burrow restriction, EXCEPT to go nom nom on another dwarf. Just burrow them into a test chamber, lock and forbid the door, then wait.
Less garanteed, but faster method:
A vampire will never have a spouse present at the embark. Married couples are exempt from suspicion, if the spouses are both present. Vampires will sometimes claim to be married, but their spouse is fictitious, so they will never accompany them.
Vampires tend to bounce around governments and settlements like pinballs. As such, any dwarf with more than 5 entries for "former member of" in their preferences page are suspect. Any dwarf with absurdly high social skills (use therapist to spot quickly) is also immediately suspect.
More exotic proceedural sort method: (if you don't mind some nomnomnom happening)
Divide the fortress population in half, and segregate them such that they cannot mingle.
Wait for noming to happen.
Free the innocent half.
Divide the suspect half in half again.
Wait for nomming.
Rinse, repeat.
Statistically, you should locate the vampire within 7 deaths.
(Eg, start with approx 200 dwarves.
First death clears 100 of those.
Second death clears 50 more.
Third death clears 25 more.
Fourth death clears 12 more
Fifth death clears 6 more
Sixth death clears 3 more
At this point there are only 3 dwarves. One of which will be the victim.
Lock them in a room together. The survivor is the vampire.)