select v.CreationDate as tstamp,
'invote' as action,
case when v.VoteTypeId = 1 then 15
when v.VoteTypeId = 2 then p.PostTypeId * 5 -- cheeky 5 or 10 for question/answer
when v.VoteTypeId = 3 then -2
when v.VoteTypeId = 9 then IsNull(v.BountyAmount, 0)
else 0
end as rep
from Posts p, Votes v
where v.PostId = p.Id