I can see following alter statements in the sproc.
alter table Process_Trn_backup add createdby varchar(150),Createdon date
alter table NonCore_Process_Dtls_Backup add createdby varchar(150),Createdon date
You can not execute CREATE/ALTER statements directly in a stored procedure.