September 7, 2004 at 3:20 am
I have written a cursor that gets all the relevant data for each dept and emails them the results. How can I export the results to them in an excel spread sheet, it cannot be a single spreadsheet as only the relevant data must be sent to the dept.
any help will be appreciated
September 7, 2004 at 10:33 am
Interesting problem. I think what you want to do is loop through a series of departments and call a DTS package to email the results. At least that's what I'd do.
Here's a looping example: http://www.sqldts.com/?246
Or my choice, use one package to loop and call another inside it: http://www.sqldts.com/default.aspx?215.
September 7, 2004 at 11:40 am
A script was posted many moons ago that took on this issue from T-SQL, I've neved had a need to actually try it out but it looks like it should at least come close to what you need.
http://www.sqlservercentral.com/scripts/contributions/763.asp
Everett Wilson
ewilson10@yahoo.com
September 8, 2004 at 4:32 am
I've achieved something similar to this using a table variable, sp_makewebtask and xp_smtp_sendmail.
The table variable holds the list of departments which are passed one at a time to sp_makewebtask which just creates a tab-delimited text file and then xp_smtp_sendmail emails it out.
--------------------
Colt 45 - the original point and click interface
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply