Drug inspectors in Maryland have violated their own regulations thousands of times since 1977 by not obtaining written permission from pharmacists before marching into their stores to inspect drugs.

The violations surfaced recently when a Bowie pharmacist, Neil Jacobs, cited the regulations to two state inspectors who were attempting to check the dates of drugs on his shelves. The inspectors, Jacobs said, left his store "in a huff" after conceding that they had not given advance notice of their visits.

But as a result of Jacobs' protest, the state officials who run the drug inspections decided that rather than direct their agents to follow the regulations, they would attempt to rewrite the rule so that advance notice no longer would be required.

"Jacobs has been squabbling for some time about being overregulated," said Standish McClearly III, an assistant attorney general who now is helping to change the regulations. "He said: 'You're not following your own inspection rules.' He was right. They were written to require written consent on the part of the phamacist. But I couldn't find any legal justification for that to be contained in the regulations."

Jacobs, who charged that he is being harassed by inspectors because he informed them that they were ignoring their own rules, said the regulations were important to prevent inspectors from acting "improperly or unlawfully."

Jacobs has run his family pharmacy in the Whitehall shopping center for 10 years. There are about 850 pharmacies in Maryland, and each is visited at least twice a year by drug inspectors.

The rules say that the inspectors can go behind a pharmacist's counter to verify records, check to see if presecriptions are properly filled, or determine if there are outdated drugs on the shelves.

But they also require that the inspectors issue formal notice before an inspection and obtain written consent from the pharmacist. In addition, a pharmacist can terminate the inspection at any time, and the inspectors must then return with an administrative warrant before they can continue an inspection.

According to John Crosby, a spokesman for the state environmental health department, which runs the drug inspections, the regulations were originally patterned after federal procedures that said inspectors had to issue a formal notice before beginning their inspection.

But Irv Myers, former head of the inspection division, said the inspectors had never been challenged on it by pharmcists until Jacobs. "We have never given notice of inspection," said Myers, ". . . Because of (Jacobs') insistence on wanting notice of inspection, we . . . decided to delete the regulations."

One pharmacist contacted last week said it was an "unwritten law" that inspectors could come in without a formal notice or written permission.