First point, i would like to know, Do you have any comment on the way i wrote the script ? Is it scalable?
Again, having the indexes right is the most important.
Also, use temp tables rather than table variables.
The script is likely to be scalable up to some point where you exhaust the memory in the server and operations need to spill to disk. A common approach to avoid this is to divide the operation into batches.
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
No comments:
Post a Comment