[dba-SQLServer] SQL Server 2005 - View to table

jwcolby jwcolby at colbyconsulting.com
Fri Nov 23 09:56:10 CST 2007


In processing orders for "the big database" I often end up with some rather
complex queries, which take a loooong time to complete (> 30 minutes) and
results in a small number of records (anywhere from a few million to tens of
thousands) pulled from a large records set (50 million).  In any case, it is
usually helpful to pull the resulting data into a table for a variety of
reasons, starting with the fact that I need to be able to sort.
Additionally I need to be able to select a subset of THOSE records, perhaps
just 10K of the possible records, and TRACK which records were already used.

So, I am trying to use the export wizard to use the vOrder view as the
source, and send the data to a tblOrder in the SAME SQL Server database.
IOW I build a database for each order, build up the views using data from
tables out in other databases, then build a final view that "puts it all
together", and finally save the result set to a table in the order database.


It seems like it should work, and in fact it seems to be trying to work, but
is currently hung on "setting source connection".  Who knows, it may be
trying to run the query, and in 1/2 hour when that is completed, it may
march onwards.  

My question, is this a valid thing to do?  SQL Server should be able to
handle this right?  Is there a better way to do this?

John W. Colby
Colby Consulting
www.ColbyConsulting.com 




More information about the dba-SQLServer mailing list