say hey co-worker your small talk distracts me from my work so go small talk to someone else.
say I am busy
say I am a professional and your small talk offends my professionalism
say oh really oh really oh really until they go away
These are great!! lol
Tell them you are reading a story about what to do if you are secretly in love with a male/female coworker; ( whatever sex they are), mmm but this may backfire...
Hi, sorry but... I'm kind of busy right now.
I'm sorry but I have no time for small talk. I'm very busy.
It depends a lot on whether you think that person will ever be your boss or have the ear of your boss. If so, you should be very careful how you tell him to bugger off. Something like "I'm really sorry, but I have to get this done" might be enough. If that is not enough, try "I get paid to work, and I take my commitments very seriously." If you know he has little future in your world you use the ever effective "why don't you just fook off! You're more annoying that chlamydia." Or try crying and tell him to stop harassing you.
Say....I'm on a deadline. We can catch up later at lunch.
If you like the person, tell him/her "I like talking to you, but it bothers me that you talk to me so much at work. Can we go for a coffee later this week after work to catch up on each other's lives?"
If you don't like the person, don't let him/her dominate the conversation and instead tell s/he a boring story about your cat, the last episode of a soap etc. Something you know doesn't interest them. That might deter them from speaking to you again. Basically just don't let them speak. Alternatively just look away and keep working until they go away. "I don't want to get fired, so I'm going to concentrate on my work now" should work too.
I will say this to them directly.
Go away, you're botherin me.