Results 1 to 7 of 7
Nov 22, 2013, 03:20 #1
- Join Date
- Jul 2009
- 0 Post(s)
- 0 Thread(s)
Convert MySQL LAST_INSERT_ID() to MSSQL 2005
I'm converting an ASP site that is using MySQL to run on MSSQL 2005.
On some pages, after a new record has been created, I need the ID (primary key) of the newly created record to pass as a querystring to the next page (for various reasons). Currently I use the MySQL LAST_INSERT_ID() to grab the last entered "ID" immediately after the INSERT code. The Last_Insert_ID() code looks like this:
Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open "SELECT LAST_INSERT_ID()", dbconn tmpmemId = rs1(0) rs1.Close
Is there an equivilant function in MSSQL 2005 that will achieve the same result?
Hope someone can help.