Update procedures.sql

Optimized the update, no need to count every message each time.
(can take a lot of time on big Databases)

This is the first of a list of pull requests i will submit