Page 1 of 1

Hyperlinking Microsoft SQL errors

Posted: Tue Mar 11, 2003 6:06 am
by Peter Wone
I'm trying to get hypertext linking of compiler errors from Microsoft SQL Server. Here's the RE:

Code: Select all

Line \([0-9]+\)
and here's a sample of the text I'm trying to match

Code: Select all

Msg 207, Level 16, State 1, Server DEBTOR0003, Line 1
Invalid column name 'DL_C_BAILIFF_FEE_CLIENT_TOTAL_PAYABLE'.
Msg 207, Level 16, State 1, Server DEBTOR0003, Line 1
Invalid column
The interesting thing is that when I use the Find dialog to test the RE, it works - "Line 1" is highlighted.

Yet I keep getting the message "Cannot jump to item under cursor"

For those interested in shelling OSQL from Textpad, here's the parameter list:

Code: Select all

-Uusername -Ppassword -Sservername -w16384 -ddatabasename -i$File -n -e
You can get a full list of OSQL command line parameters using OSQL /? on the command line. For the terminally lazy [sic] here they are:

Code: Select all

usage: osql              [-U login id]          [-P password]
  [-S server]            [-H hostname]          [-E trusted connection]
  [-d use database name] [-l login timeout]     [-t query timeout]
  [-h headers]           [-s colseparator]      [-w columnwidth]
  [-a packetsize]        [-e echo input]        [-I Enable Quoted Identifiers]
  [-L list servers]      [-c cmdend]            [-D ODBC DSN name]
  [-q "cmdline query"]   [-Q "cmdline query" and exit]
  [-n remove numbering]  [-m errorlevel]
  [-r msgs to stderr]    [-V severitylevel]
  [-i inputfile]         [-o outputfile]
  [-p print statistics]  [-b On error batch abort]
  [-O use Old ISQL behavior disables the following]
      <EOF> batch processing
      Auto console width scaling
      Wide messages
      default errorlevel is -1 vs 1
  [-? show syntax summary]

Posted: Tue Mar 11, 2003 11:48 am
by MudGuard
The problem might be that there is no file name in the line containing the error message...

I also sometimes had problems if the regex did not match the complete line.
Try this:

Code: Select all

.*Line \([0-9]+\).*

No filename

Posted: Tue Mar 11, 2003 9:07 pm
by Peter Wone
You're quite right about no filename but that's ok, I just want it to refer to the most recent edit buffer. That part I can get to work.

I shall try your suggestion of matching the whole line.

Match the whole line

Posted: Wed Mar 19, 2003 8:59 pm
by Peter Wone
For the record, Mud-guard was correct. When hyperlinking errors from the results page your regex must match the whole line.

The simplest way to check this is to exercise the expression in the search dialog. It should highlight a whole line.