Doesn't work in most cases. My wife, after a lot of encouragement from me, tried what you suggested. She told the current employer that she had not gotten a decent raise for the past 4 years. Her peers had gotten much better raises because they showed job-offers from other employers. She was getting a lot of calls from other potential employers too, but she didn't want to play the ransom game (I have this offer, now match it!). The employer told her that they can't offer her a good raise till she does exactly that -- bring an offer from outside. The problem is that when she does bring an offer and they try to match it, she'll not be interested in the match because she'd have made up her mind to leave.
This policy seems to attract and keep the wrong kind of employees -- those you're willing to play the ransom game from time to time.