Place the sugar, vinegar, water, soy sauce, ketchup and cornstarch in a medium saucepan, and bring to a boil. Stir continuously until the mixture has thickened.