To clarify, as is clear from the example, Teddy has shown there the T-SQL
way of doing the replace (he doesn't mean the CFML Replace function), which
would mean either doing it in the SQL Server Enterprise Manager (or
Management Studio in 2005), or trying to do it in a CFQUERY, though often
the database driver will preclude use of statements other than SELECT,
INSERT, UPDATE, DELETE, and similar.
 
Someone else may suggest to Michael that he could do it all in CFML, pulling
the data in via a SELECT, doing the replace in CFML, and then updating the
record, but unless you have no other choice, it would be generally more
efficient to do it in the database directly. And if you needed to do it
recurrently and programmatically (rather than manually), it would still be
better to look into creating a stored procedure on the server and calling
that. Hope that helps.
 
/Charlie
http://www.carehart.org/blog/  

  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Teddy Payne
Sent: Friday, December 08, 2006 4:44 PM
To: discussion@acfug.org
Subject: Re: [ACFUG Discuss] Data Update



REPLACE


Replaces all occurrences of the second given string expression in the first
string expression with a third expression.


Syntax


REPLACE ( 'string_expression1' , 'string_expression2' , 'string_expression3'
)


<snip> 


 Examples


This example replaces the string cde in abcdefghi with xxx.

SELECT REPLACE('abcdefghicde','cde','xxx')

GO





-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

<<attachment: image002.jpg>>

Reply via email to