I need to process records from a table and need to log the outcome of processing of each record. One can pass a datatable to a stored procedure instead to insert all of them by using ADO.NET SqlDbType.Structured (more info here). I need to build that datatable and then pass to the stored procedure. Would this approach still optimal with more that 12k rows (for the datatable) inside a Windows service? I am afraid this might consume too much memory on the server?
Not sure If I can build the datatable in batches and pass them to the stored procedure in this scenario.
EDIT :- In those 12K rows, there are no huge blobs on each row. It would be guid (Id), string (status) and string(ErrorMessage, If any) on each row.
Any advice or suggestion would be helpful.
Table-Valued Parameters should be fine for 12K rows, even if the occasional status / error message values are longer.
Of course, you could always try it, since there are a lot of variables that may impact whether performance is acceptable, and we can’t possibly account for all these variables that are specific to your environment, the application, and any extraneous apps or processes.