I have a stored procedure which has 4000 lines of code it is in reporting and when I run the procedure, I get a NULL value somewhere in that code. How can I best trace or track at what line that NULL value is being assigned?
Suppose I am using a variable such as getName and I am assigning a value to the variable in the procedure… How should I trace the values of getName or how I can watch this variable after assigning a value to it?
A 4000 line stored procedure is far too large. If you are putting this much logic in a stored procedure, you should think about refactoring into for example a business layer/data access approach.