October 28, 2014 at 5:08 am
Hi,
I am trying to move data from one table to the another (staging to real time) in a stored procedure.
There are no indexes or primary keys on the target table and it is still taking ages to execute it (30 minutes approx.). There are no defaults, no constraints as well. There is one identity int column though.
There are some 500000 odd rows in the target table.
I am using the
Insert into..
Select from..
method.
What am I missing?
October 28, 2014 at 7:38 am
I'd suggest looking at the system to see what it's waiting on. You can query the dynamic management views to pull information out. This book (free download) shows a number of queries that will help. It could be any number of things. If these databases are on different servers it could just be the network. If they're on the same server, it could be resource contention or blocking caused by other processes. It's hard to say without more information.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 28, 2014 at 8:25 am
Couple questions, how wide is the table? And how long does just the select take(no insert)?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply