I've made a bit of a hash of this I'm afraid. Firstly I ran the latest script ok but had problems getting my scheduled job to work .......... so I deleted the old sp and the new one and tried running the new script again but when I do I get the error shown below. Please help.
Msg 102, Level 15, State 1, Line 49
Incorrect syntax near 'Calculation'.
Msg 111, Level 15, State 1, Line 67
'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.