Dogs can be master manipulators, especially when it comes to begging for food. If your dog has a bad habit of going to other people to score a snack, you have to devise a solution for both him and the people who enable his behavior. The best and easiest method for stopping this behavior is simply preventing it, and making sure that neither you nor anyone else ever rewards it.
Feed your dog before you sit down to eat. If seeing and smelling your food makes him hungry, give him some food beforehand so he has something to munch on at the same time as you.
Instruct people who eat with you to never give your dog a scrap, no matter how much he begs. If you or they relent after 20 minutes of begging, it only teaches your dog that persistence pays off. You need complete consistency across the board to stop your dog from eating your or other people's food, so make it a zero-tolerance policy.
Separate your dog from you and your fellow diners while you eat. This may mean putting him in another room with a baby gate, behind a closed door or in his crate.
Give your dog a special treat during your own meal time. Giving him a special snack or toy during this period can give him the distraction he needs to leave you alone while you eat.