Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-11-21 : 07:52:48
|
| Ray writes "I am using a search and replace function that I found on your web site. However when I run it I get the following message and error:Text found in row id=- at pos=4502Text found in row id= at pos=7940Text found in row id= at pos=2552Text found in row id=r at pos=-1Server: Msg 7135, Level 16, State 2, Line 47Deletion length 1 is not in the range of available text, ntext, or image data.The statement has been terminated.I labled the guilty party below. My max text field size is 64512. The function is below:/*** Search & Replace ** Use Ctrl+Shift+M to replace template values**/set xact_abort onbegin trandeclare @otxt varchar(1000)set @otxt = ','declare @ntxt varchar(1000)set @ntxt = ''declare @txtlen intset @txtlen = len(@otxt)declare @ptr binary(16)declare @pos intdeclare @id varchardeclare curs cursor local fast_forwardforselect problem, textptr(problem), charindex(@otxt, problem)-1 */Guilty party*/from support_incident where problem like '%' + @otxt +'%'open cursfetch next from curs into @id, @ptr, @poswhile @@fetch_status = 0begin print 'Text found in row id=' + cast(@id as varchar) + ' at pos=' + cast(@pos as varchar) updatetext support_incident.problem @ptr @pos @txtlen @ntxt fetch next from curs into @id, @ptr, @pos endclose cursdeallocate curscommit tranThanks. Ray" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
nr
SQLTeam MVY
12543 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|