Combine the squash, onion, sugar, and salt with enough water to cover. Bring to a boil, reduce and simmer until tender, drain. Spoon squash mixture into a bowl and mash. Add butter and mix. Stir in the eggs and add the cheddar cheese, milk, bread crumbs and cayenne pepper and mix. Spoon into a buttered 8x8 baking dish. Sprinkle with Parmesan. Bake at 350 for 30 minutes or until brown and bubbly.