> -----Original Message-----
> From: Tony [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 14, 2005 10:00 AM
> To: CF-Talk
> Subject: big reports, 13k lines
> 
> hola peeps.
> 
> when dealing with a large report, from sql server, how do you
> as a best practice deal with getting it into a CSV file, elegantly
> without the server timing out, and killing resources?
> 
> i am using query2csv, which is ok, but the query takes nearly
> four minutes to run, then whatever time the query2csv takes to
> run, and all in all, it can lead to a bad user experience.
> 
> any ideas will be mucho appreciated.

Are you actually using the query as a query anyplace?

If not you could pull the CSV rows directly from the database and save it.
Something like:

SELECT A.Col1 + "," + A.Col2 + "," + A.Col3 AS Row

That will eliminate 15,000 loops from your processing.  ;^)

There's probably a way to pull the entire CSV (as a single data cell) from
the database but my SQL's not up to snuff on that one.

If it were SQL Server I'd probably use osql (the command line SQL Server
tool) to pull the data and save it to a file.  CF could do that using
CFExecute (perhaps in an asynch process) and be out of the picture entirely.

You can then use AJAX-style processing to check for the file until it's
ready for download.

Jim Davis



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224092
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to