Etl 4 replace stored procedure

The job is fully working
There are some minor TODOS to check, and we will also change the way it reads the database properties