Microsoft Access中的Scope_Identity() [英] Scope_Identity() in Microsoft Access
本文介绍了Microsoft Access中的Scope_Identity()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在Microsoft Access中编写一个数据库,以使客户端不必购买SQL Server. 您如何获得我刚刚插入的行的主键?在SQL Server中,它是
I'm writing a database in Microsoft Access to save the client from having to buy SQL Server. How do you get the primary key of the row that I just inserted? In SQL Server, it's
INSERT INTO TABLE(FIELDLIST) VALUES(VALUELIST)
SELECT * FROM TABLE WHERE PrimaryKeyID = SCOPE_IDENTITY()
推荐答案
尝试:
选择@@身份
SELECT @@Identity
这篇关于Microsoft Access中的Scope_Identity()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文