What is the Identity after ASP executes the insert

Results 1 to 3 of 3

Thread: What is the Identity after ASP executes the insert

  1. #1
    Join Date
    Dec 1969
    Posts
    716

    Default What is the Identity after ASP executes the insert

    I&#039m mainly an Oracle developer and when we use sequences I would basically retrieve the next id by stating:<BR><BR>SequenceName.nextval into a variable<BR><BR>In SQL it&#039s called an indentity. My question is if I run an insert like so:<BR><BR>set myinsert = dataConn.execute ("insert into me (myname) values (&#039justin&#039)")<BR><BR>then somehow without writing a new select query, have the id number that was assigned. <BR><BR>I&#039m going to submit this in the Database Forum as well. Thanks,<BR><BR>Justin

  2. #2
    Cheryl G. Guest

    Default RE: What is the Identity after ASP executes the in

    The following should grab the identity of the newly created record in SQL Server:<BR><BR>Set identifier = dataConn.execute("SELECT @@IDENTITY FROM me")<BR><BR>Hope that helps you!<BR><BR>Sincerely,<BR>Cheryl Galvez<BR>Bliss!(tm)<BR>www.blissezine.com

  3. #3
    Join Date
    Dec 1969
    Posts
    6

    Default RE: What is the Identity after ASP executes the in

    Thanks Cheryl...<BR>It is saying that there are properties for that variable "identifier" though. Do I need to assign it to a recordset or something else to retrieve the number?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •