My client needs to update part of a varchar string, e.g. "change all records
containing '1234' in a column with '5678' and maintain the rest of the
string as is" for multiple tables and multiple columns, perhaps 20 cases in
all. The string '1234' is in the same position in all cases.
I tried using a cursor and fetch to iterate through a result set, parse the
varchar string and update the record, but got an error stating:
<eb1>Number of results grid generated reached the maximum
limit. The maximum limit is 1,500.</eb1>
There must be a better way. Is using a cursor not the way to do this? How
should this task be accomplished? Many TIA.
The batch file is:
DECLARE myCursor CURSOR
FOR SELECT gldebitacct FROM dbo.LABTRANS WHERE gldebitacct LIKE '%1032'
FOR UPDATE OF gldebitacct
OPEN myCursor
FETCH NEXT FROM myCursor
BEGIN
BEGIN
{Statement block}
FETCH NEXT FROM myCursor
END
END
DEALLOCATE myCursor
--
Neill Laney
http://home.nc.rr.com/nlaney
--