Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace vs Sql Update()
Message
From
02/11/2006 14:15:45
 
 
To
02/11/2006 14:01:29
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01166701
Message ID:
01166705
Views:
13
There is a third option, and it's MUCH faster than option 1.
REPLACE MyField1 WITH Var1, ;
MyField2 WITH Var2, ;
MyField3 WITH Var3, ;
MyField4 WITH Var 4 IN MyAlias

I can't say if it's faster than UPDATE, but I've tried to stay with SQL compliant syntax. It helped me get up to speed with SQL Server.


>Which is better between #1 and #2 below and is there a big performace difference between the two.
>
>1.) Performing 20 of these commands:
> REPLACE myfield1 WITH var1 IN mytable
> REPLACE myfield2 WITH var2 IN mytable
> REPLACE myfield3 WITH var3 IN mytable
> etc...
>
>VS
>
>2.) Performing 1 of these commands:
>UPDATE mytable SET field1 = var1, field2 = var2, etc...
> WHERE myprimaryfield = somekey
>
>Thanks,
>
>Jerry
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform