Walgreens Boots Alliance (WBA -2.16%) and CVS Health (CVS -2.68%) are two stocks that offer attractive, above-average yields. Walgreens' yield of 8.6% is particularly appealing as it can give investors some mouthwatering dividend income without requiring a huge investment. CVS, meanwhile, may have more growth potential given some recent acquisitions, and that could lead to some sizable dividend increases in the future.

Which stock is a better option for dividend investors? Let's compare.

The case for Walgreens Boots Alliance

Walgreens stock yields 8.6%, and that is massive when you consider that the S&P 500's payout is less than 1.6%. To collect a $1,000 dividend, you would only need to invest approximately $11,600 in Walgreens stock. The pharmacy retailer has also been a stable dividend investment over the years. It has increased its payout for decades, and it has made payments consistently for over 90 years.

Investors, however, have been bearish on the business as its earnings have been deteriorating, its CEO recently stepped down, and it also lowered its guidance for the year. As a result, investors have had plenty of reasons to dump the stock, which is down more than 40% this year.

But the company still projects adjusted earnings per share of at least $4 for the current fiscal year. Its payout ratio based on that metric would put it at less than 50%. While Walgreens is investing heavily in primary care as it looks to improve its growth prospects, it may still be able to sustain this level of dividend. The company recently raised the projections for its transformational cost savings program, up from $3.5 billion to $4.1 billion.

As Walgreens looks for more opportunities to save money, the dividend could prove to be safe. And with the stock trading at less than six times its estimated future earnings, there's some good margin of safety with this investment, potentially making Walgreens an appealing contrarian buy.

The case for CVS Health

CVS Health pays a much smaller dividend yield of 3.5%. To earn $1,000 in dividend income from this healthcare stock, you would need to invest close to $28,600. It's a much higher buy-in, but it's one that looks to be more sustainable.

A big reason is that CVS has generated $17.7 billion in free cash flow over the trailing 12 months. Its dividend payments during that stretch only cost it $3 billion. There's plenty of room for CVS to not just continue paying but also increase its dividend in the future. By comparison, Walgreens has struggled to consistently generate positive cash flow, leaving in doubt its ability to continue raising dividends. And while Walgreens has an impressive dividend streak, CVS has made more generous rate increases over the past decade.

WBA Dividend Chart

WBA Dividend data by YCharts.

The company's recent acquisitions of Signify Health (home health) and Oak Street Health (primary care) will further diversify and expand CVS' long-run growth opportunities. With strong free cash flow to support both its future growth and the dividend, the stock can give investors a good mix of income and growth potential. At only eight times its expected future profits, CVS is also a relatively cheap stock to own.

Which dividend stock should you buy?

High-yielding dividend stocks can be attractive, but the danger is buying risky investments solely for the payout. If a company ends up slashing its dividend, then the motivation to hold the stock could be gone. Investors are better off going with the more stable business in CVS. Its yield may not be as high, but its growth prospects look much better than those of Walgreens.

It could take Walgreens years before its healthcare business becomes profitable, and in the meantime, it's going to need to continue to fund it to keep it growing. And the company's poor cash flow is going to put more of a strain on its operations as long as it has to pay such a high dividend. Sooner or later, I expect the company will make a change to the dividend policy -- perhaps with a new CEO.

CVS is a solid dividend investment as the stock comes at a good valuation, and with some solid growth potential and free cash flow, its recurring income could become much higher in the future.