[dba-SQLServer] Export wizard hangs

jwcolby jwcolby at colbyconsulting.com
Wed Sep 23 09:41:37 CDT 2009

I am trying to export 50 million names / addresses to a CSV file.  I did so once using a simple 
query that pulls from a single table.  I realized I needed to join on the zip from another table (in 
a zip code database) which filters down which zip codes and states I use.  this is normal stuff, I 
do it all the time.

I have a query which I built to do this.  I can do a count (PKID) on this table and get results back 
in just a few seconds.  However the export wizard exports about 50K records and hangs "performing 
operation", with the little circle widget a circlin'.

Indexes applied on all relevant join fields etc.

It has something to do with the join to the ZipCodeWorld out in the other database.  Take that out 
and the thing flies.  50K records / second perhaps.  Put the zip code view back in to the source 
query and the thing slows to a crawl.  It looks like it is doing 10K chunks every 30 seconds or so.

I use this zip code world view all of the time!  Joined to this and other tables.  And the weird 
thing is that I can view the data and it opens instantly and starts displaying data like a mad man. 
  Count the PK from the view and it counts in just a few seconds.  But the export wizard is having 
problems with the view, but only when that zipcode view is joined in.

Any ideas why?

John W. Colby

More information about the dba-SQLServer mailing list