Reputation: 456
I have a script that, at some point, updates several large tables. The tables are independent of each other, have 40+mil rows and each row is updated by resetting an integer value. Something like:
update table table_with_40_mil_rows set integer_column=1
update table table_with_70_mil_rows set integer_column=1
etc.
Processing of each such statement takes between 8 and 15 minutes.
Is there a way to run 2 or more of these table updates in parallel? The disks are pretty fast and 8+ cores are available.
Thanks
Upvotes: 1
Views: 106
Reputation: 5940
Vanilla T-SQL will not give so much possibilities to run few updates in parallel. As exceptions - asynchronous service broker, but it is advanced topic.
The more or less easy ways:
Upvotes: 1
Reputation: 31785
Not as long as they are in a single script running on the same connection. SQL Server cannot be made to process a single script in an asynchronous, threaded fashion. At least not in TSQL. Maybe in a CLR procedure.
Upvotes: 1