Is there any option to kill the particular process automatically if it is consuming a particular value of cpu?

some sort of sql Proccess makes my database server to consume 100% of the cpu, Is there any option to kill the particular process automatically if it is consuming a particular value of cpu ?