English 中文(简体)
将巨大的数据传送到储存的散装插入程序,或一次插入一个记录
原标题:Passing huge datatable to a stored procedure for bulk insert OR inserting one record at a time

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 : - 在这12K行中, 每行没有巨大的浮标。 每行中将使用 guid (Id) 、 status (status) 和 string (ermorMessage, 如果有的话) 。

任何建议或建议都会有所帮助。

最佳回答

表值参数对12K行应罚款,即使偶发状态/错误信息值较长。

当然,你总是可以尝试, 因为有很多变量 可能会影响性能是否可以接受, 我们可能无法解释所有这些变量, 都与你的环境,应用程序, 以及任何不相干的应用程序或过程有关。

问题回答

暂无回答




相关问题
ADO.NET Entity Data Model are not precise enough

I run this code: var cos = from k in _db.klienci_do_trasy where k.klient_id == 5 select k; but the query send to database is: SELECT * FROM `klienci_do_trasy` LIMIT 0, 30 why is it for, there ...

Synchronising SQL database through ADO.Net

The problem that i m having is how can i synchronise my datasets in my VS 2008 project to any changes in the database. As you know we read data from the db into the dataset which is disconnected, now ...

ADO.NET Data Services - Uploading files

I am trying to write REST web service through which our clients can upload a file on our file server. IS there an example or any useful links which I can refer for any guidance? I haven t seen many ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

热门标签