Loop through all the rows of a temp table and call a stored procedure for each row

后端 未结 5 848
独厮守ぢ
独厮守ぢ 2020-12-08 14:52

I have declared a temp table to hold all the required values as follows:

    DECLARE @temp TABLE
    (
    Password INT,
    IdTran INT,
    Kind VARCHAR(16)
         


        
5条回答
  •  广开言路
    2020-12-08 15:28

    Try returning the dataset from your stored procedure to your datatable in C# or VB.Net. Then the large amount of data in your datatable can be copied to your destination table using a Bulk Copy. I have used BulkCopy for loading large datatables with thousands of rows, into Sql tables with great success in terms of performance.

    You may want to experiment with BulkCopy in your C# or VB.Net code.

提交回复
热议问题