It depends. was that sugar from an energetic drink or a soda? both will give you energy but negative consequences at the end first it may seem good because your body is more awake but then you will feel tire and maybe soreness!
ex: my teacher always carry with her a coke she seems pretty energetic but one day she lost it and her face was all down and pale why was it? well this whole time she wasn't using her body resources of energy and always used the one that came with her drink once that wasn't available her body needed to start burning and using his own energy (fat) and that leaded to a low energy period of time her body didn't want to respond to that situation and was waiting for the energy from the coke!
in conclusion a big amount of sugar can give you the energy you need but remember that will just make it worse! get enough sleep and try avoid sugar!