Ask a Question related to Coldfusion Database Access, Design and Development.
-
akcreative #1
AutoFiled
Hi
I am adding a record to database field having ID as autonumber. I want to retrieve the auto value on the same template. How can I do that.
Thanks in advance
Mike
akcreative Guest
-
SQLMenace #2
Re: AutoFiled
If you are using SQL server you can use the @@IDENTITY function or IDENT_CURRENT
Or select Max(Id) from table
SQLMenace Guest
-
hatethisnamegame #3
Re: AutoFiled
For Access:
<cftransaction>
<cflock name="addStuff">
<cfquery> insert data </cfquery>
<cfquery>
SELECT MAX (itemID) AS NewitemID
FROM itemsTable
</cfquery>
the auto value can now be accessed by referencing #NewItemID#
hatethisnamegame Guest



Reply With Quote

