Building a Stored Procedure Need Next Id

This is probably super basic but I've never built a procedure where I'm writing to a table where I need to pull the next id. Can someone walk me through how to find the next id, assign it on the insert, and then make sure that the next id table gets updated?

Thanks in advance!

Parents
  • either of you up for helping a gal out and looking at some SQL?! I have a procedure all built and running and we've just now realized that every once in a while there is a funk thing happening. I'm copying information into a research note from another table and it creates a random second note that has the same cust_notes_no as the one before it with incorrect information that seems to be pulling from another record but I haven't been able to establish where or why it's happening. When I run the procedure to check it out I cannot get it to recreate the issue. 

Reply
  • either of you up for helping a gal out and looking at some SQL?! I have a procedure all built and running and we've just now realized that every once in a while there is a funk thing happening. I'm copying information into a research note from another table and it creates a random second note that has the same cust_notes_no as the one before it with incorrect information that seems to be pulling from another record but I haven't been able to establish where or why it's happening. When I run the procedure to check it out I cannot get it to recreate the issue. 

Children