Does this happen every time you run the code or only when certain input parameters are given?
I don't think SQL Server 7 has the stored procedure debugger does it?
I take it this is a somewhat complex stored procedure with multiple steps?
Here's what I would do to debug. First I would comment out all but the first line (line being flexible, what I really mean is the first complete SQL statment) of code and then run the procedure. If it didn't bomb, I would uncomment the next section of code and run the procedure. Keep doing this until you find the section it is bombing on.
Another thing I do when I have a complex procedure with a lot of different possible branches is to put a different select statement in each branch that is something like Select 1, Select 2, etc.
It will return all the select statements in query analyzer that were in branches executed and you can see right away whether it went to the branches you intended and if not where it went wrong. This will also give you a hint as to where it is hanging up if it gets in a processing loop because you can see which statements are being repeated or which was the last one executed.
Something else that can help in debugging complex stored procedures is print out the procedure and number each begin end statement pair. You will often find the source of your problem is that one of the pairs does not end where you thought it should.
I know none of this is specific to your problem, but it may give you some things to try.