Posted by --CELKO-- on 02/20/07 17:12
Do an UPDATE statement with nested REPLACE() functions to change (n)
spaces to 1 space:
UPDATE Foobar
SET mystring = REPLACE (SPACE(2), SPACE(1) ' ,
...
REPLACE (SPACE(<<fib(n)>>), SPACE(1),
mystring)
.. )));
The optimal pattern for the substitutions is a Fibbonnaci series with
the longest string of spaces in the innermost invocation. You have to
pick the right number based on the length of the column. Working out
the math is fun, so enjoy.
[Back to original message]
|