finding @@identity value of adjacent record

Results 1 to 2 of 2

Thread: finding @@identity value of adjacent record

  1. #1
    Join Date
    Dec 1969

    Default finding @@identity value of adjacent record

    Hi,<BR><BR>Trying to write a stored procedure in SQL 2000 that returns the results of a query, but then also returns the @@identity value of the next record that matches the query parameters...<BR><BR>In other words I return the results of the query to the web page, user may make some changes to the record and then submit it, but I then want them to be taken directly to the next record that matches the original query. Basically there will usually be 10 - 20 records returned based on the query, so I would like it to display the first record, then when they hit the submit button, that are automatically taken to the next record and so on...<BR><BR>I played around with an array containing the selected @@identity values of the rows matching the query, but I didn&#039;t get too far.<BR><BR>Thanks very much..

  2. #2
    Join Date
    Dec 1969

    Default RE: finding @@identity value of adjacent record

    what I&#039;d do (and in fact what I&#039;ve done very recently) is to basically do exactly as you would when paging through a recordset n records at a time, but paged one at a time. you then don&#039;t need the IDs, just an idea of what &#039;page&#039; you&#039;re on. on clicking submit, you make sure to pass the page number and increment it, then jump right back to the editing page, but with a different page parameter.<BR><BR>I&#039;ve used it recently to built a &#039;wizard&#039; for editing user records, which could range from 1 record to maybe 30, and it works pretty well for me...<BR><BR><BR>j<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