Added active/state sql updates for alltables