Sunday, February 26, 2012

error_line() not accurate?

Hello,

I'm just trying out this new try-catch stuff in sql server 2005....

Using the example from the help, "Using TRY... CATCH in Transact-SQL" , it shows how things are done in the adventure works database.. loggin the error to the errorlog table and all that... looks great.. but I notice that when I implement this code in my project.. and tested by putting in a line that causes a divide by zero error... that the line number reported by error_line is acutally not the line at which the divide by zero code resides....

Any suggestions as to what would put the error_line out of whack? I have comments and some string literals in the code..would they be throwing it?

Thanks

Try posting a sample here that others can recreate. That way we can address the issue specifically.

No comments:

Post a Comment