By Benjamin Pimentel

The tech sector held on to a small gain Tuesday as gains from SanDisk Corp. helped keep the Nasdaq Composite Index in the green.

SanDisk (SNDK) was ahead more than 4%, helping boost the Nasdaq (RIXF) by a fraction to 2,025.

The Morgan Stanley High Tech 35 Index (MSH) was mostly flat, while the Philadelphia Semiconductor Index (SOX) was up a fraction.

Other gainers included Intel Corp. (INTC), Amazon.com (AMZN) and Apple Inc. (AAPL).

Google Inc. (GOOG) rose 0.7% after being upgraded by ThinkEquity to buy.

But the sector was weighed down by other major tech players, including Dell Inc. (DELL), Juniper Networks (JNPR) and Palm Inc. (PALM).

The Dow Jones Industrial Average (DJI) gained more than 40 points as Wall Street reacted to Ben Bernanke's reappointment as chairman of the Federal Reserve and to better-than-anticipated home-price data.