This post is part of a series dedicated to database access. This is the stored procedure that creates new rows in the database.
It is very simple; it has all the columns of the table to which it belongs as input parameters. If the primary key is an identity it is converted to an output parameter in order to send the new created key to the calling layer for future use.
In order to retrieve the value of the primary key I use the IDENT_CURRENT function.