How Do I Tell Which Line Contains the Error?

  • I just received an error in my code.

    Msg 207, Level 16, State 1, Line 76

    Invalid column name 'PDP'.

    This is something I should already know by now, but how do I tell which line is line 76? If I just count down 76 lines there is a blank line.

    Thanks.

  • CTRL-G

    enter line number

    or you can just double-click on the message in the results pane

  • Thanks again, Pam! You are a great help!

  • The Best way is for you to add a Try Catch statement.

    Look at the image below, there is a code intended to fail and show you the line number on which it failed.

    Ysaias Portes | Forward Thinkers Consulting
    sp_SQLFlightRecorder — open-source SQL Server diagnostic recorder | forwardthinkersconsulting.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply