>Hi all,
>
>normally I would do a seek on a table that has a 2 field index, if I find the entry I update a field, if not I create a new record.
>I was thinking about changing this to an update command, but wondering if there are any issues, speed mainly, with this.
>
>update table1 set field3 = "some data" where field1 = "ABC" and field2 = "DEF"
>if _tally = 0
> insert into table1 (...) values(...)
>endif
>
>it doesn't seem to slow things down as against a seek but I'm wondering if this is the dont thing.
>the reason I would like to move to an update command is to modify code to be more like .net and sql which we're migrating to.
>
And, in fact, SQL Server has the MERGE command that lets you do this in a single step. I wrote about it earlier this year in FoxRockX.
Tamar