January 4, 2006 at 1:51 am
begin
SELECT @ptrval_s = TEXTPTR(Text_Column) ,
@patptr=patindex('%123456789123456789',Text_Column)
FROM MyTable where Id=1
end
January 4, 2006 at 7:22 am
First insert_offset is zero based
Second your patindex will only find occurrance if the column ends with 123456789123456789
Try this
WHILE 1=1
BEGIN
SELECT @ptrval_s = TEXTPTR(Text_Column),
@patptr=PATINDEX('%123456789123456789%',Text_Column)-1
FROM #MyTable where Id=1
IF @patptr < 0 BREAK
UPDATETEXT #MyTable.Text_Column @ptrval_s @patptr 18 'xxx'
END
Far away is close at hand in the images of elsewhere.
Anon.
January 4, 2006 at 7:30 am
Thank you, "-1" was a problem
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply