It depends on the circumstances, as well as the state , since not all of them have the same systems in place for monitoring these things.
Most states now have the
prescription monitoring program (PMP), and the link details the status of them in each state. Pharmacists enter each controlled substance a person is prescribed into the database, and that information can be accessed by other pharmacies, doctors, and law enforcement. This prevents people from getting away with doctor shopping by the old method of paying cash and using different pharmacies. Before these monitoring systems were implemented, it was the persons insurance that they had to worry about, so as long as they did not use their insurance for multiple doctors/prescriptions, there was a lesser chance of being caught.
If a person goes to a new doctor for a condition that may require a controlled substance to be prescribed, the doctor can check the PMP database to see your prescribing history (the link above shows how long the data is kept for). Even if he doesn't check it and goes ahead with prescribing you another controlled substance while you are already getting one from another doctor, the PMP will catch on to this.
So what happens then?
In the case of my friend who saw two doctors for the same thing, he received a letter in the mail about it. I don't remember what company/agency sent it though, but the letter came off as them being concerned, instead of saying he was busted (although it did say they notified both prescribing doctors about it). It said that they sent the letter because their records indicated he was seeing multiple doctors, and they notified both him and the doctors in order to prevent him from having any dangerous drug interactions from combinations that he may be taking since both doctors did not know they were both treating him and prescribing him stuff. The letter also said that another reason they send them is to notify the doctors the person is seeing in an attempt to minimize prescription drug abuse and diversion, which as we know is probably the only reason they sent it. It is then up to those doctors to continue treating you or not, but I'm sure that if one of them does, they will be very cautious of what they prescribe you from then on. In the case of my friend the doctors sent him a letter refusing to see him again.
Other than viewing your prescribing history in the PMP, I am not sure if there is any official way for you to be labeled a drug seeker such that any other doctor you see in the future would be notified of this, unless maybe your insurance can do that. I don't think that there is a main "drug seeker" database that would come up with a hit if any doctor were to search the name of someone caught doing this. I could be wrong though, I just haven't heard of such a thing (other than rumors) with a link to support the claim.
Your doctor can take note of it in your patient file at their office, but I don't think that info would be seen by anyone other than the other doctors in that same office/practice that might see you for an appointment. The same would apply to the ER if you keep going there for pain meds and the doctors catch on and put that you are a drug seeker in your file there. I was labeled a drug addict at the doctors office where I had gone to school. The psychiatrist that I was supposed to see cancelled on me twice, any my school was very far away from my psychiatrist at home and I was about to run out of xanax that I was prescribed for a while (psychiatrist from home sent me a script the first time the new psychiatrist cancelled, but did not feel comfortable sending anymore). I made an appointment at the doctors office and told them I needed a xanax prescription because the psychiatrist cancelled on me already, and I had just run out after stretching out the script for a long time. The nurse practitioner that I had the appointment with finally gave in and wrote me a script after verifying that I had been prescribed in for a while, but she felt the need to write in my file that I was an addict. That never left that office AFAIK, but whenever I had an appointment there and a different doctor or NP would see me, they would ask about it when they asked if I was on any medications and I told them diazepam, and they basically just said the other nurse wrote in my chart that I was an addict. It never mattered since I never needed any pain killers or anything while I was in school there, plus the other doctors were understanding that I had been stuck without xanax and I had told the nurse I was dependent on them and she automatically took that as being addicted. I've never had an issue being prescribed any controlled substances needed since then.
"Doctor shoppers" will get caught by prescription monitoring systems, but I don't think that someone that a doctor deems a drug seeker (exaggerates/fakes/lies about pain or anxiety in an attempt to get a prescription) will have any repercussions other than losing that doctors trust and/or them refusing to see you again.