Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting current SQL sequence value in VBScript

    Hi,
    I am trying to put the current value from an SQL sequence onto the end of a querystring.

    *****
    Example:

    SQL = "INSERT INTO testing VALUES (test_seq.nextval,'testing',2)
    RS1 = Execute SQL

    response.redirect("/testpage.asp?testid=_____")
    *****
    test_seq is the name of the sequence and I want that number to be then put where the ______ is.

    Is this possible?

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you want the ID generated by the INSERT?

    If so then in Access and SQL Server you can use @@IDENTITY
    http://www.kamath.com/tutorials/tut007_identity.asp


  •  

    Posting Permissions

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