Eight teenagers have been pricked by a hypodermic needle at a Sydney high school following what is believed to be a prank gone wrong.

Acting Inspector Shane Rolls says the incident is the result of childish behaviour and all victims are currently undergoing tests for infections.

The NSW education department has offered counselling and support to students and staff.