The Shulhan Aruch (Orah Haim 202:15) writes explicitly that the Beracha recited over sugar is "She’ha’kol." This follows the view of the Rambam (Rav Moshe Maimonides, Spain-Egypt, 1135-1204), who maintained that although sugar is taken from the sugar cane, which grows on trees, the sugar is not a fruit, but rather a liquid extracted from the tree. As such, it does not receive the Beracha of "Ha’etz" which we recite over fruits. The Tur (Rabbenu Yaakob Ben Asher, 1269-1343) disagreed, and maintained that sugar indeed has the status of a fruit, and requires the Beracha of "Ha’etz."
Of course, Halacha follows the view of the Shulhan Aruch, and one who eats a candy made from sugar recites "She’ha’kol," which in any event suffices for any food, thus satisfying all opinions. However, Rav Yisrael Bitan (contemporary) cites Hacham Ovadia Yosef’s ruling (in Halichot Olam) that the Tur’s position must be taken into account if one plans to eat both a fruit and a candy. If the person recites "Ha’etz" over the fruit, then according to the view of the Tur, his Beracha covers the candy, and he can then not recite a Beracha over the candy. Therefore, in order to satisfy all opinions, a person in this situation should have specific intention when reciting the Beracha over the fruit that the Beracha should not cover the candy. This way, he can then recite "She’ha’kol" over the candy. If he did not have this intention, Hacham Ovadia ruled, then he should not recite a Beracha over the candy, given the uncertainty involved.
Summary: Although the Beracha over sugar – and candies consisting mainly of sugar – is "She’ha’kol," some Halachic authorities felt that the proper Beracha is "Ha’etz." Therefore, if one is eating both a fruit and a sugar candy, he should have specific intention when reciting the Beracha of "Ha’etz" over the fruit that the Beracha should not cover the candy, so he can then recite a Beracha over the candy. If he did not have this intention, then he does not recite a Beracha over the candy.