If you have two such stored procedures, then it would seem that you have a need for both of them from the calling code. The stored procedure to insert a single record is definitely simpler to call than one that requires a table as an argument.
I would suggest implementing one of the stored procedures in terms of the other. If the spInsertBatch
is looping through and adding records one at a time, instead call the spInsertUser
within the loop. If the spInsertBatch
is doing the inserts in a single batch, then re-implement spInsertUser
by populating a table variable and calling spInsertBatch
.
By doing the actual inserts in one place, you can control logging, data validation, and business logic checks in one place. By keeping two stored procedures, you can simplify the interface for the code making the calls.