Link to home
Start Free TrialLog in
Avatar of m_evergreen
m_evergreen

asked on

Get Key ID in Stored Procedure after Insert

If I have a database with a key field, and I want to insert a new row such as
 
Insert into Customer(Name, houseNum)
values(@name, @housenum)
 
then I want to get the key for that new row, what would be the best method for getting it?  Can I do it in the same stored procedure or do I have to make a new one?

Thank You!
-M
Avatar of Tdl
Tdl
Flag of Switzerland image

Is the key an identity field?

Regards,
Marc

ASKER CERTIFIED SOLUTION
Avatar of rafrancisco
rafrancisco

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