Are you running the code using Management Studio (SQL 2005) or Query Analyzer (SQL 2000)?
Sometimes the “compiler” cannot ubicate the exact place where the error appears.
You can create the SP in phases: each time place the “go” in a different place and see what are the parts that run successfully without returning the error, until you reach the problematic place.
It would help me help you if you could post the code of the Proc.
When debugging SQL Procedures you need to remember to remove the white space above the ALTER PROCEDURE line when counting down the lines.
What happens if you run the entire procedure out side of the procedure. In order words comment out the ALTER PROCEDURE line and manually set any input parameters. Then when the error comes up you can double click on it to get to the offending line(s) of code.