CHICAGO (Reuters) - Target Corp's (>> Target Corporation) sale of its in-store pharmacies to CVS Health Corp (>> CVS Health Corp) may encourage large supermarket chains with struggling pharmacies to look for professional drug store partners of their own.

More than 1,660 Target pharmacies will become CVS units in the $1.9 billion deal, the first time a drugstore chain has expanded its pharmacy business within a third party retail store, pharmacy consultants and analysts said.

Drug stores in recent years have focused on opening new stores, an effort which has slowed recently.

Target pharmacies helped drive overall sales at the chain but lost money, as the government health care program known as Obamacare expanded ranks of insured and increased pressure on costs.

"Grocery store chains must be taking the news today and thinking hard about it. Pharmacy is not really a core competence," said Todd Huseby, partner, AT Kearney said, citing Safeway and Albertsons as two companies that might consider it. Neither responded to a request for comment.

Some supermarkets may have the scale and buying power to make their own pharmacies work, said Neil Stern, senior partner at retail consulting firm McMillan Doolittle. They may see the store-in-store format as an opening for a competitor, he said.

However, margins are eroding, said Adam Fein, president of advisory and research firm Pembroke Consulting.

"The future of pharmacy is really about being a low cost buyer of generic drugs and capability to dispense specialty drugs and that is an area of challenge for several supermarket operators," he said.

Supermarkets with pharmacies such as Kroger (>> Kroger Co), Safeway and Stop & Shop saw a 0.6 percent increase in the number of prescriptions filled, but a 0.17 percent decline in prescription market share in 2014 from a year earlier, data from Fein's blog Drug Channels showed.

Last year, prescriptions filled at chain drugstores like CVS, Walgreens , Rite Aid (>> Rite Aid Corporation) rose 5.1 percent, with 1.41 percent growth in prescription market share, while mass merchant chains like Wal-Mart Stores Inc (>> Wal-Mart Stores, Inc.) increased market share by 0.32 percent.

Wal-Mart's health and wellness business has been performing very well, and it sees no need to have pharmacies handled by another company, spokeswoman Sarah McKinney said.

Drug store chains could look to stores-in-stores as a way to get "immediate access to new markets at a much lower cost," than building their own stores, said Tom Charland, chief executive at consulting firm Merchant Medicine.

(Reporting by Nandita Bose in Chicago; Editing by Richard Chang)

By Nandita Bose and Nathan Layne