![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a table that every 30 minutes needs to be repopulated from another table that is recreated from scratch just before. What I did was this: CREATE PROCEDURE BatchUpdProducts AS begin transaction delete products insert into products select * from productsTemp commit transaction GO This takes about 30 seconds to run. I tried it doing it with a cursor, row by row, but it took like 30 minutes to run instead. The problem is with the fast approach is, once in a while I get a deadlock error in different areas trying to access the products table. Using SQL Server 2000 by the way. Any ideas? |
#3
| |||
| |||
|
|
Are those section that are getting the dead lock just doing read only or do the need to right? Wolfing wrote: I have a table that every 30 minutes needs to be repopulated from another table that is recreated from scratch just before. What I did was this: CREATE PROCEDURE BatchUpdProducts AS begin transaction delete products insert into products select * from productsTemp commit transaction GO This takes about 30 seconds to run. I tried it doing it with a cursor, row by row, but it took like 30 minutes to run instead. The problem is with the fast approach is, once in a while I get a deadlock error in different areas trying to access the products table. Using SQL Server 2000 by the way. Any ideas? |
#4
| |||
| |||
|
|
I have a table that every 30 minutes needs to be repopulated from another table that is recreated from scratch just before. What I did was this: CREATE PROCEDURE BatchUpdProducts AS begin transaction delete products insert into products select * from productsTemp commit transaction GO This takes about 30 seconds to run. I tried it doing it with a cursor, row by row, but it took like 30 minutes to run instead. The problem is with the fast approach is, once in a while I get a deadlock error in different areas trying to access the products table. Using SQL Server 2000 by the way. |
![]() |
| Thread Tools | |
| Display Modes | |
| |