Hi Fabio, thanks for the reply.
IF 1 # SQLEXEC(lnConnHandle, ;
[;
DECLARE @newId INT;
UPDATE UniqueId SET @newId = nLastNumber = nLastNumber + 1 WHERE ]+m.lcFilter;
+ [ SELECT @newId AS nNewNumber], 'UniqueIdV')
ENDIF
That's neat! A couple of questions...
a) SET @newId = nLastNumber = nLastNumber + 1. Is this the same as SET @NewId=nLastNumber+1,nLastNumber=@NewId (ie. SET both @newid and nLastNumber to nLastNumber+1)?
b) The code is not explicitly locking the record before the upddate. Does the UPDATE command guarantee a lock on the record? (In other words, do I definitely NOT need to wrap the code in a transaction?)
Regards,
Alan