Technically - if:
1) there's a BEGIN TRANSACTION to match that COMMIT TRANSACTION or you're using the Manual Transaction setting from VFP.
2) you don't mind SQL Server making two passes through the table.
IMO, I see no reason to make SQL Server do the extra work when there's a facility for just this purpose. Also, my perferred approach would be for you to call a stored procedure that would do the work and return the new value as an output parameter.
CREATE PROCEDURE incCounter
@newValue int OUTPUT
AS
Update Pecas_Parm Set @newValue = PD_ExpLiPC = PD_ExpLiPC + 1
IF @@ERROR != 0 SET @newValue = NULL
-Mike
>Looking at your code I wonder: could it be implementented like this, too?
>
> cSQLString = "Update Pecas_Parm Set PD_ExpLiPC = PD_ExpLiPC + 1; Select PD_ExpLiPC From Pecas_Parm; Commit"
>
> SqlExec (nHandle, cSQLString, CurResult)
>
> nPD_ExpLiPC = CurResult.PD_ExpLiPC
>