February 5, 2009 at 9:14 am
Hi,
I have a query, which gets the resultset of the CUSTOMERS. And, need to loop through each CUSTOMER row and load it into excel sheet. If the customer registered in January then insert into January SHEET, its its February then insert into February SHEET, like that.
At the end, I need to create EXCEL sheet with 12 sheets with customer data, each sheet for every month.
Please let me know how best we can achieve this...
Thanks,
Ramu
February 5, 2009 at 9:20 am
Define "best".
Is this something that needs to be done once? If so, then run the queries for the months and copy and paste the results into Excel and be done with it.
Is it something that needs to be done yearly? I'd probably still go with copy and paste.
Anything more frequent than that, I'd set up an SSIS package and schedule it in a job.
Definitely wouldn't loop through records and all that.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply