David Klemitz
2004-01-04 12:04:59 UTC
Hi folks,
I'm kind of new to this so might be missing something obvious. I
loaded the script that makes up the 'instr' function (from SQL Server
Worldwide Users group) that allows me to search for the last occurence
of a substring in a character string.
I loaded the script using 'SQL Query Analyzer' and it appeared to
accept the code. When I tried to call the function using the following
I get ''INSTR' is not a recognized function name'.
update tbl_songs
set OldName=substring(SongPath, INSTR(SongPath, '\', -1),
datalength(SongPath) - 1)
I have seen other posts that recommend the use of 'patindex' and
'charindex' instead- however I am looking for the *last* occurence of
'\' not the first. Does the instr script need to be registered somehow
within SQL Server 2000 ?!?
any help appreciated
regards
David
I'm kind of new to this so might be missing something obvious. I
loaded the script that makes up the 'instr' function (from SQL Server
Worldwide Users group) that allows me to search for the last occurence
of a substring in a character string.
I loaded the script using 'SQL Query Analyzer' and it appeared to
accept the code. When I tried to call the function using the following
I get ''INSTR' is not a recognized function name'.
update tbl_songs
set OldName=substring(SongPath, INSTR(SongPath, '\', -1),
datalength(SongPath) - 1)
I have seen other posts that recommend the use of 'patindex' and
'charindex' instead- however I am looking for the *last* occurence of
'\' not the first. Does the instr script need to be registered somehow
within SQL Server 2000 ?!?
any help appreciated
regards
David