Link to home
Start Free TrialLog in
Avatar of BlakeMcKenna
BlakeMcKennaFlag for United States of America

asked on

Need to perform a DB Insert then return an ID?

I need to write a Stored Procedure that will Insert a record into a Table and then return the Primary Key and I'm not sure how to do that. I'm using SQL Server 2008.
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BlakeMcKenna

ASKER

Thanks guys...that worked!
Okay, I'll bite.  How did my comment not correctly answer the question?
Jim,

Your answer was correct. Since there were 2 correct answers, I accepted multiple answers.
I'm showing that only the second answer was accepted, so if your intent was to split you'll need to re-open the question and re-award points.
How do I reopen a ?
Sorry...I'll redo it!
Thanks for the split.  Good luck with your project.  -Jim
Your welcome...and thanks!