SELECT SCOPE_IDENTITY() http://www.aspfaq.com/show.asp?id=2174
Ray at work > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of GLSmyth > Sent: Tuesday, June 21, 2005 11:06 AM > To: [email protected] > Subject: [ASP] Most Recently Entered Record > > > I have forgotten how to do this and know that someone out > there must have the answer on the tips of their fingers. > > I insert a row into a SQL Server database, then need to get > the primary key of that row. Of course, one way to do this > is to do a select on the table, getting the last row, but if > someone else has inserted a row then it does not work. > > I know that there is a way to have the primary key returned > after inserting a row, but just cannot remember how to do it. > If anyone could note how it is done I would greatly appreciate it. > > Cheers - > > george > > > > > -------------------------------------------------------------- > ------- > Home : http://groups.yahoo.com/group/active-server-pages > --------------------------------------------------------------------- > Post : [email protected] > Subscribe : [EMAIL PROTECTED] > Unsubscribe: [EMAIL PROTECTED] > --------------------------------------------------------------------- > Yahoo! Groups Links > > > > > > > --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
