(For a Reuters live blog on U.S., UK and European stock markets, click LIVE/ or type LIVE/ in a news window)

* Tesla set to add $40 bln to market cap

* Walmart rises as profit beats on online boost

* Walgreen, CVS hammered by Amazon's online pharmacy foray

* Futures: Dow down 0.7%, S&P down 0.6%, Nasdaq up 0.3%

Nov 17 (Reuters) - The S&P 500 and the Dow were set to open lower on Tuesday, retreating from record closing highs a day earlier as more U.S. states took measures to contain the COVID-19 pandemic.

The Nasdaq 100 futures rose 0.3% as Tesla Inc's shares soared 12.6% premarket in anticipation of a $51 billion trade by index funds adjusting their holdings when the company is added to the benchmark S&P 500 in December.

The Dow notched an all-time closing high on Monday, finishing about 50 points shy of 30,000 points after Moderna Inc's promising COVID-19 vaccine data boosted hopes of an economic recovery, overshadowing spiking coronavirus cases across the country.

"There is conflict for the market between the near-term direction to the economy, which is troubled with the very high COVID-19 rates and the future for the market, that's which vaccines could provide an end to the restrictions," said Rick Meckler, partner at Cherry Lane Investments in New Vernon, New Jersey.

New Jersey, California and Iowa imposed fresh restrictions as the pandemic reached its most perilous point yet in the United States, threatening to worsen as the colder weather sets in.

At 08:22 a.m. ET, Dow E-minis were down 0.66% and S&P 500 E-minis were down 0.58%.

The second positive update from a U.S. vaccine trial has encouraged investors to diversify into value stocks, which outperformed growth stocks over the past week as they poised to benefit from a pickup in the economy.

Amazon.com Inc rose 2.1% after it launched an online pharmacy for delivering prescription medications in the United States. Drug retailers such as Walgreens Boots Alliance Inc tumbled 9.1%, while CVS Health Corp fell 7.3% on the news.

Warren Buffett's Berkshire Hathaway Inc disclosed new stakes worth $5.7 billion in drugmakers Abbvie Inc, Bristol-Myers Squibb Co, Merck & Co and Pfizer Inc, lifting their shares between 1.1% and 2.7%.

U.S. October retail sales missed estimates, increasing less than expected, with retail earnings in focus this week as the third-quarter earnings season enters its tail end.

Walmart Inc rose about 1% after posting a bigger-than-expected increase in quarterly same-store sales.

Kohl's Corp was down 1.5% after the department store reported a bigger-than-expected decline in quarterly same-store sales as the virus outbreak hammered demand for its apparel and footwear. (Reporting by Shivani Kumaresan and Shriya Ramakrishnan in Bengaluru; Editing by Shounak Dasgupta)