Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

update columns in Table A based on columns in Table B for more than 500K rows

$
0
0

Guys,

I need to update 9 columns in table A based on value from table B for for more than 500K rows.

So what is best way to achieve this. I am thinking of writing a Procedure with cursor to update the rows of table A.

When i googled about it, they say cursor will decrease the performance. So i have no clue how to go for this.

Rough code which i though

1) Procedure  with no parameter

2) Will declare 9 variable to store value from cursor

3) cursor will fetch row by row based on join condition between table a and table b

4) i will pass column values from table B to variables

5) will make an update statement for table A

Please let me know if above method is correct or is there any other way to do this without using cursor.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>