tag:blogger.com,1999:blog-6718406939865222936.post1018539826321026878..comments2024-03-16T20:51:58.301+01:00Comments on the web thought: SQL Server: basic functions (part 8) - @@IDENTITYMarco Del Cornohttp://www.blogger.com/profile/00863522198118005628noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6718406939865222936.post-24092801452987793192012-07-05T12:28:14.161+02:002012-07-05T12:28:14.161+02:00When using a Dreamweaver Insert Behaviour sometime...When using a Dreamweaver Insert Behaviour sometimes you want to retrieve the last inserted identity value.<br /><br />Put this script between MM_editCmd.Execute and MM_editCmd.ActiveConnection.Close. <br /><br /><br />MM_editCmd.CommandText = "SELECT @" & "@IDENTITY AS Ident"<br />Set rsLastIdent = MM_editCmd.Execute<br />If NOT rsLastIdent.EOF Then<br />Session("LastIdent") = rsLastIdent("Ident")<br />End IfStill_aspnoreply@blogger.com