1create procedure DeleteIndex()
2begin
3
4IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 'TableName'
5 AND INDEX_NAME = 'IndexName' AND INDEX_SCHEMA='DbName') THEN
6 ALTER TABLE TableName DROP index THead2;
7END IF;
8END
9