Results 1 to 7 of 7

Thread: Retrieve Unique ID for a new Record

Hybrid View

  1. #1
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Retrieve Unique ID for a new Record

    If it's not a parameter for the SP, why are you using it?

  2. #2

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Retrieve Unique ID for a new Record

    It is or at least should be a parameter for the SP. I tried it again with the @ and still get the similar error

    Procedure 'sp_InsertRequestID' expects parameter '@PK_RequestID', which was not supplied

    It should be the return value therefore an outpout parameter.. I think
    Last edited by FishGuy; May 5th, 2005 at 04:14 AM. Reason: more detail

  3. #3
    Addicted Member
    Join Date
    Nov 2004
    Posts
    149

    Re: Retrieve Unique ID for a new Record

    I retrieved the @@Identity a little differently when I needed the new uniqueID.

    Instead of trying to retrieve it back as a parameter I simply wrote:

    SELECT @@Identity

    Just make sure that where you execute the the command you are receiving the ID:

    intID = comSQLProc.ExecuteScalar

    You could try that.

Posting Permissions

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



Click Here to Expand Forum to Full Width