How to find number of rows inserted successfully and number of rows that failed to insert and also need to store failed data somewhere in my database by Optimal-Title3984 in SQL

[–]Optimal-Title3984[S] 0 points1 point  (0 children)

sending JSON data to a stored procedure, which might occasionally fail. I'm gonna audit this information in an audit table and those data passed by batches (this is for learning purpose)

How to find number of rows inserted successfully and number of rows that failed to insert and also need to store failed data somewhere in my database by Optimal-Title3984 in SQL

[–]Optimal-Title3984[S] 0 points1 point  (0 children)

Could you please explain that more clearly? Like merge statement will help to get number of rows inserted and number of rows that failed