I was getting the same error and I solved it by puting Go at the end of my stored procedure after END