|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Help with traversing a HUGE table
First I apologize if this is a basic question. This is all fairly new to me.
I am attempting to extract data from a table with 6 million plus records. With each record I qury several other tables and then submit to a new table. It works great when I select the top record. My problem is that I need to traverse the entire table. I use cursors in other parts of the script but think that trying to use a cursor on a 6 million record table is a little stupid. Does anyone have some advice on a different way? Thanks in advance! SGlauner |
|
#2
|
|||
|
|||
|
If you have'nt already check out these and some other links on www.sql-server-performance.com - its quite helpful.
http://sql-server-performance.com/cursors.asp http://sql-server-performance.com/transact_sql.asp In most cases you should try to avoid using cursor - try replacing it with a set based operation. I'd suggest before you submit to the new table, make sure you drop the indexes before your inserts/updates and recreate them at the end - that way you save SQL server the overhead to check referential integrity constraints. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Help with traversing a HUGE table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|