Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scope_Identity() in Microsoft Access

Tags:

ms-access

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()
like image 618
Phillip Senn Avatar asked Feb 09 '10 16:02

Phillip Senn


1 Answers

Try:

SELECT @@Identity

like image 109
jinsungy Avatar answered Oct 10 '22 06:10

jinsungy