Hyperlinking Microsoft SQL errors

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Peter Wone
Posts: 12
Joined: Tue Mar 11, 2003 5:52 am
Location: Brisbane, Australia
Contact:

Hyperlinking Microsoft SQL errors

Post 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]
Last edited by Peter Wone on Tue Mar 11, 2003 9:05 pm, edited 1 time in total.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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]+\).*
Peter Wone
Posts: 12
Joined: Tue Mar 11, 2003 5:52 am
Location: Brisbane, Australia
Contact:

No filename

Post 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.
Peter Wone
Posts: 12
Joined: Tue Mar 11, 2003 5:52 am
Location: Brisbane, Australia
Contact:

Match the whole line

Post 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.
Post Reply