The S&P 500 and Nasdaq fell slightly on Wednesday on concerns about foreign debt and a weak outlook in the tech sector, but positive wholesale inventory data limited losses.

Ratings agency Standard & Poor's revised its outlook on Spain to negative, a day after Fitch Ratings downgraded Greece's debt. The moves, coming amid fears that Dubai's debt problems could spread to other parts of the Gulf region, raised concerns about another global credit crisis.

The real issue is what this could do as countries turn to their taxpayers to raise revenue in order to protect their credit worthiness, said Kevin Caron, market strategist at Stifel, Nicolaus & Co in Florham Park, New Jersey.

This could mean higher tax rates when we have to pay for the stimulus, and that would hurt growth going forward.

Tech stocks, considered one of the first sectors to recover from recession, were pressured a day after Texas Instruments gave a fourth-quarter earnings view that disappointed some investors who had hoped for signs of improving demand. The chipmaker's stock fell 2.6 percent to $25.65.

The Dow Jones industrial average <.DJI> rose 7.40 points, or 0.07 percent, to 10,293.67. The Standard & Poor's 500 Index <.SPX> fell 2.20 points, or 0.20 percent, to 1,089.63. The Nasdaq Composite Index <.IXIC> fell 5.50 points, or 0.25 percent, at 2,167.49.

The Dow gained after U.S. wholesale inventories rose 0.3 percent in October, according to Commerce Department data, reversing a 13-month declining trend. Analysts were expecting inventories to fall 0.5 percent.

Added to November's improving jobs report on Friday, the inventory figure shows surprising resilience as we work to recover, said Thomas Nyheim, portfolio manager at Christiana Bank & Trust Co. in Greenville, Delaware.

Also lifting the Dow was 3M Co , which rose 3 percent to $79.44 after Citigroup upgraded the stock.

(Editing by Kenneth Barry)