Execute a sql query before a content-type change manually

is there anybody?