>Is it possible to use a subquery to return the KeyID of a newly INSERTed record? Something like this:
>
>
>select max(keyid) from (insert into tip (st_name) values ('test'))
>
>What would be the syntax?
>Thanks
No. There have to be two separate commands. The second may be
select GetAutoIncValue()
for the AutoInc ID in VFP.
In SQL Server you can either use OUTPUT clause or select SCOPE_IDENTITY()
If it's not broken, fix it until it is.
My Blog