I use the REPLACE function in a UDF, to test an incoming string.
That allows me to test stuff in a SELECT with no UPDATE until after
inspection.
So, if the UDF (user defined function) is named dbo.udfGarbageRemoval, I can
use "inline" SQL to do the preliminary testing and inspection job.
For example:
SELECT udfGarbageRemoval(<fieldname>, <width>), <field> FROM <table> ORDER
BY <blah>
This gives me immediate results for inspection with no transaction required.
I simply sort ASC and DESC on the field in question, do some Q&A and test
cases, and if the function works, then I do my update as follows:
UPDATE <table>
SET <field> = udfGarbageRemoval(<field>, <width>)
This techique if VERY fast, with no transaction nor update required until
after testing.
Functions are very easy to write in SQL, and blindingly fast.
John Smith
[quoted text, click to view] "Preacher Man" <nospam> wrote in message
news:erpibxHEGHA.336@TK2MSFTNGP14.phx.gbl...
> Can the Update command be used in the EM or the QA?
>
> "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@avtenta.si> wrote in
> message news:uBF72cHEGHA.2872@TK2MSFTNGP14.phx.gbl...
>>> What is the SQL equivalent to a REPLACE ALL command in VFP?
>>
>> IIRC Replace in VFP is used to update table records. To update rows in a
>> SQL table, use the UPDATE statement.
>>
>>> I found this in the help section:
>>> SELECT REPLACE('abcdefghicde','cde','xxx')
>>> GO
>>>
>>> Is this the full syntax and where would I use this command, I tried in
>>> the EM but it doesn't seem to work.
>>
>> You found Replace function, which is not equivalent to VFP Replace
>> command.
>>
>> --
>> Dejan Sarka, SQL Server MVP
>> Mentor
>>
www.SolidQualityLearning.com >>
>>
>
>