all groups > sql server connect > january 2006 >
You're in the

sql server connect

group:

REPLACE ALL


Re: REPLACE ALL David Portas
1/3/2006 7:05:38 AM
sql server connect:
[quoted text, click to view]

REPLACE ALL is basically similar to an UPDATE statement in SQL Server.
That is, both statements are used to update existing rows in a table.
For example:

UPDATE your_table
SET x = 123,
y = 456
WHERE z = 999 ;

You can find the full syntax in SQL Server Books Online.

--
David Portas
SQL Server MVP
--
Re: REPLACE ALL ML
1/3/2006 7:55:03 AM
Yes, it can. I suggest you use QA. And use transactions - i.e. commit the
changes only after you've inspected the results and they are correct.


ML

---
REPLACE ALL Preacher Man
1/3/2006 8:54:09 AM
What is the SQL equivalent to a REPLACE ALL command in VFP?

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.

Re: REPLACE ALL Anith Sen
1/3/2006 9:05:32 AM
Lookup REPLACE is SQL Server Books Online.

--
Anith

Re: REPLACE ALL Anith Sen
1/3/2006 9:08:50 AM
Ignore it :-(

--
Anith

Re: REPLACE ALL Preacher Man
1/3/2006 9:39:39 AM
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...
[quoted text, click to view]

Re: REPLACE ALL David Portas
1/3/2006 3:51:25 PM
[quoted text, click to view]

I recommend you use Query Analyzer. I think the only way to do it through EM
would be to create a proc containing the UPDATE statement. QA is the better
tool for SQL development.

--
David Portas
SQL Server MVP
--

Re: REPLACE ALL Dejan Sarka
1/3/2006 4:05:59 PM
[quoted text, click to view]

IIRC Replace in VFP is used to update table records. To update rows in a SQL
table, use the UPDATE statement.

[quoted text, click to view]

You found Replace function, which is not equivalent to VFP Replace command.

--
Dejan Sarka, SQL Server MVP
Mentor
www.SolidQualityLearning.com

Re: REPLACE ALL John Smith
1/12/2006 12:02:49 AM
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]

AddThis Social Bookmark Button