PATINDEX Instruction Result Difference between SQL 7 and SQL 2000.
0 pts.
0
Q:
PATINDEX Instruction Result Difference between SQL 7 and SQL 2000.
I am running the same SQL statement on SQL2000 with different results from SQL 7.

What I'm actually trying to do is search a 30 byte character string for a certain pattern. I am looking for the following 9 digit pattern.

1) 1st Digit = any number (0-9)
2) 2nd Digit = any number (0-9) or the letter A,B,C,F,H,M,P,U,or Y.
3) 3rd Digit = any number (0-9) or the letter
4) 4th Digit = any number (0-9) or the letter
5) 5th Digit = any number (0-9) or the letter
6) 6th Digit = any number (0-9) or the letter
7) 7th Digit = any number (0-9) or the letter
8) 8th Digit = Any thing
9) 9th Digit = any number (0-9) or the letter

If that pattern is found Ok the resulting field has the correct information. If that pattern is not found a NULL value is passed in the resulting field in SQL 7 which is what we expect for a reult. However, in SQL 2000 it passes back an invalid patterned field as shown below.

SQL instruction:
select SUBSTRING('QUOTE ISSUED: NFHUM48A1 ', PATINDEX('%[0-9][ABCFHMPUY0-9][0-9][0-9][0-9][0-9][0-9]_[0-9]%','QUOTE ISSUED: NFHUM48A1 '), 9)

Resulting field SQL 2000 = 'QUOTE IS '

Resulting field SQL 7 = Null (This is desired result)


Can anyone give me a suggestion on how to obtain the same result as was received in SQL 7 or a different method to accomplish the same issue.

Thanks
Rich
ASKED: Sep 23 2004  12:01 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
0 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Sorry but I am just a novice at SQL. I probably wouldn't be much help to you.
Last Answered: Sep 24 2004  10:08 AM GMT by LuanaL   0 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0