Judith1, your are not alone, you are not a bad mother (quite the opposite, because you obviously care !)and your 2 year old is behaving like a 2 year old.
My dd is very similar, and on bad days I don't know which of us screams the louder.. Like Anabani and Alih I've found it easier if I just stand back slightly and let her get on with it - I used to worry what other people thought but I don't care now - in fact I've found I get lots of sympathetic comments & glances. If it's not practical to wait I just bundle her up under my arm and remove her from the situation.
Our situation is starting to slowly improve but I've re-read Christopher Green's Toddler Taming many times over the past few months. The only thing that works for me is to be utterly consistent and act on my promises eg 'if you don't behave properly here, we'll have to go straight home without stopping at the swings'. We've only been straight home once but she remembers that I'm willing to enforce that if necessary and a couple of reminders are usually enough.
It's really hard though, and my mum has been on the end of many a tearful phone call when I've been at my wits end. I'm a very short-tempered, emotional person (wonder where dd gets it from ??!) and sometimes I've had to put her in her room for a few minutes while I calm myself down.
Three things keep me going on bad days, one is that in many ways I'm glad dd will challenge things rather than be a pudding, the second that like yours when she's being lovely she's fabulous and the third is a sentence from Toddler Taming which says that 'yours may appear the worst in the shop, the Precinct or the even the entire city, but there are always many more difficult little ones, whose mothers have learned from experience not to take shopping. While you are being embarassed in public, crowds of similar children are left with a neighbour, casual care or maybe even in a heavily fortified dungeon at Grandma's place'
Don't give up hope, your child is a normal toddler doing normal toddler things. Remember, the 'good' children you see may have all sorts of not so good habits which aren't visible in public. None of us are perfect (far from it in my case) we're only human beings trying to do the best for our very human children.
Good luck and keep smiling